- Renamed logging component filtering env var from
SYPL_DEBUG
to SYPL_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 the debug
level
SYPL_DEBUG="console:debug"
: any application running using Sypl with an output called console
, will log messages bellow the debug
level
SYPL_DEBUG="warn,console:debug"
: any application running using Sypl, any component, any output, will log messages bellow the warn
level, AND any application running using Sypl with an output called console
, will log messages bellow the debug
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 called svc
with an output called console
, will log messages bellow the debug
level
SYPL_DEBUG="file:warn,svc:console:debug"
: any application running using Sypl with an output called file
will log messages bellow the warn
level, and any application running using Sypl with a component called svc
with an output called console
will log messages bellow the debug
.
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.
Source code(tar.gz)
Source code(zip)