LogThe 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
The shared emit path. Level check FIRST — a filtered entry evaluates nothing and captures nothing.
See debug:.
See debug:.
The current threshold: entries below it are dropped without evaluating their message block. Defaults to #info (debug is opt-in).
Set the threshold.
Log.level:#error; Log.level "* -> #error Log.level:#info
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
The rank of a level Symbol — #debug < #info < #warn < #error. An unknown level is a ValueError, so a typo can't silently disable logging.
Restore the default 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).
Replace the sink. A custom sink can delegate to Log.stderrSink to keep the default rendering alongside its own behavior.
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.
See debug:.