Releases: saucelabs/sypl
v1.5.12
v1.5.11
v1.5.10
v1.5.9
v1.5.8
v1.5.7
v1.5.6
Added the ability to set breakpoints. If a Breakpoint
is set it'll stop execution waiting the user press /n
("enter") to continue. It helps users doing quick, and effective log-to-console debug. A message with the breakpoint name
, and PID
of the process will be printed using the debug
level. Arbitrary data
can optionally be set - if set, it'll be printed. Errors are printed using the standard error
level. Set logging level to trace
for more.
Previously, flow would look like:
- Log markers are set, e.g.:
logger.Debugln("Here 1", whatever)
- Application runs
- Scan visually
output
, or afile
- viagrep
for the markers.
Now:
- Named
Breakpoint
s are set - Application runs
- Breakpoint is hit. Information about it is printed.
- Runtime is paused, allowing analysis of
data
- if any, right way. Additionally, an external and more advanced debugger can be attached. - Dev controls the flow, pressing
enter
at any time, continue.
v1.5.5
- Exported
sypl.Name
to deal with golang/go#5819.
v1.5.4
- Renamed logging component filtering env var from
SYPL_DEBUG
toSYPL_FILTER
.
In a application with many loggers, and child loggers, sometimes more fine control is needed, specially when debugging applications. Sypl offers two powerful ways to achieve that: SYPL_FILTER
, and SYPL_DEBUG
env vars.
SYPL_FILTER
allows to specify the name(s) of the component(s) that should be logged, for example, for a given application with the following loggers: svc
, pv
, and cm
, if a developer wants only to see svc
, and pv
logging, it's achieved just setting SYPL_FILTER="svc,pv"
.
SYPL_DEBUG
allows to specify the max level, for example, for a given application with the following loggers: svc
, pv
, and cm
, if a developer sets:
SYPL_DEBUG="debug"
: any application running using Sypl, any component, any output, will log messages bellow thedebug
levelSYPL_DEBUG="console:debug"
: any application running using Sypl with an output calledconsole
, will log messages bellow thedebug
levelSYPL_DEBUG="warn,console:debug"
: any application running using Sypl, any component, any output, will log messages bellow thewarn
level, AND any application running using Sypl with an output calledconsole
, will log messages bellow thedebug
level.
NOTE: warn
is specified first. Only for this case - global scope, it's a requirement.
SYPL_DEBUG="console:debug,warn"
: In this case warn
will be discarded!.
SYPL_DEBUG="svc:console:debug"
: any application running using Sypl with a component calledsvc
with an output calledconsole
, will log messages bellow thedebug
levelSYPL_DEBUG="file:warn,svc:console:debug"
: any application running using Sypl with an output calledfile
will log messages bellow thewarn
level, and any application running using Sypl with a component calledsvc
with an output calledconsole
will log messages bellow thedebug
.
Possible scopes:
{componentName:outputName:level}
: Component, and output scoped{outputName:level}
: Output scoped{level}
: Global scope
The possibilities are endless! Checkout the debugAndFilter
example for more.