← index

Log

inherits Object · defined at core/13-log.qn:13

Class methods

debug:

The four emitting methods. messageOrBlock may be a String, an ANSI value, or a Block producing one (evaluated only past the threshold).

Log.level:#error in:{ Log.info:{ !!! } }    "* -> nil

core/13-log.qn:85

emit: message:

The shared emit path. Level check FIRST — a filtered entry evaluates nothing and captures nothing.

core/13-log.qn:98

error:

See debug:.

core/13-log.qn:94

info:

See debug:.

core/13-log.qn:88

level

The current threshold: entries below it are dropped without evaluating their message block. Defaults to #info (debug is opt-in).

core/13-log.qn:25

level:Symbol

Set the threshold.

Log.level:#error; Log.level    "* -> #error
Log.level:#info

core/13-log.qn:33

level:Symbol in:Block

Run a block with the threshold temporarily changed, restoring the previous level afterward even when the block throws. Answers the block's value.

Log.level:#debug in:{ Log.level }    "* -> #debug

core/13-log.qn:41

rankOf:Symbol

The rank of a level Symbol — #debug < #info < #warn < #error. An unknown level is a ValueError, so a typo can't silently disable logging.

core/13-log.qn:17

resetSink

Restore the default sink.

core/13-log.qn:60

sink

The active sink: a Block receiving |level message location| per entry — level the Symbol, message the (evaluated) String or ANSI value, and location the caller's 'file:line:col' String (or nil).

core/13-log.qn:50

sink:Block

Replace the sink. A custom sink can delegate to Log.stderrSink to keep the default rendering alongside its own behavior.

core/13-log.qn:57

stderrSink

The default sink: one line to [IO]Stderr — dim HH:MM:SS, the colored level label, the dim caller location, then the message. Rendered as ANSI markup, so it colors on a terminal and strips everywhere else.

core/13-log.qn:65

warn:

See debug:.

core/13-log.qn:91