Skip to content

isLevelEnabled

isLevelEnabled(level: ZylogOutputLevel): boolean

Returns true if the specified level is at or above the current minimum log level and the logger is not silenced. Useful for avoiding expensive computations for logs that won’t be displayed.

if (zylog.isLevelEnabled('debug')) {
zylog.debug(expensiveCalculation());
}