Skip to content

cdt.log ​

Lightweight leveled logger writing timestamped text or JSON lines to stderr.

Import ​

conduit
import * as log from "cdt.log"
// or
import { info, warn, error, set_level, set_json } from "cdt.log"

Functions ​

FunctionSignatureDescription
debuglog.debug(msg: String) -> VoidLogs at debug level.
infolog.info(msg: String) -> VoidLogs at info level (default minimum).
warnlog.warn(msg: String) -> VoidLogs at warn level.
errorlog.error(msg: String) -> VoidLogs at error level.
set_levellog.set_level(level: String) -> VoidSets minimum level ("debug", "info", "warn", "error").
get_levellog.get_level() -> StringReturns the current minimum level.
set_jsonlog.set_json(enabled: Bool) -> VoidSwitches between human-readable text and JSON lines ({"ts","level","msg"}).