Skip to content

Function: isLevelEnabled()

isLevelEnabled(level): boolean

Whether a call at level would be emitted at the current process.env.LOG_LEVEL threshold. Use before building expensive debug payloads.

"error" | "debug" | "info" | "warn"

boolean

if (isLevelEnabled("debug")) {
log.debug("mounts:resolver", { contribution: await heavySnapshot() });
}