Log levels and checking
Each logger has a minimum logging level per sink, set by configuration. The minimum value of the per-sink levels is the minimum level for the logger, which can be checked at any time.
Rules
- If a log request’s level is less than the minimum for the logger that created it, no log event is created and emitted.
- When a log event is emitted, it is dispatched to at least one sink.
Code
Applicable to both Klogger and NoCoLogger.
trace(),debug()etc. functions are shims forlog()with a specified value ofLevel.isTraceEnabled(),isDebugEnabled()etc. functions are shims forisLevelEnabled()with a specified value ofLevel.log()function with value arguments: only emits an event ifisLevelEnabled()for the requested level istrue.log()function with lambda argument: only calls the lambda and emits an event ifisLevelEnabled()for the requested level istrue.