shouldLog function

Last updated: 2026-03-01T23:25:47.125Z

Metrics

LOC: 5 Complexity: 5 Params: 1

Signature

shouldLog(level: LogLevel): : boolean

Source Code

function shouldLog(level: LogLevel): boolean {
  // audit, warn and error are always visible so critical issues surface even without debugLog
  if (level === "error" || level === "warn" || level === "audit") return true;
  return state.enabled && LEVEL_PRIORITY[level] >= LEVEL_PRIORITY[state.level];
}

No outgoing dependencies.

Impact (Incoming)

graph LR shouldLog["shouldLog"] flushBuffer["flushBuffer"] emit["emit"] flushBuffer -->|calls| shouldLog emit -->|calls| shouldLog style shouldLog fill:#dbeafe,stroke:#2563eb,stroke-width:2px click shouldLog "49f7fde9c48523cd.html" click flushBuffer "a9a9c3e65488e23e.html" click emit "131b8d3f5dc1f207.html"
SourceType
flushBuffer calls
emit calls