crow/log.crow (source)

new logged(level log-level, message string)

log void(level log-level, message string)

Sends a log to the current log handler.
By default, this means the message is logged to the console.

This is not considered summon since the I/O is done by the log handler,
which is passed in via the crow context. with-log-handler can change it.

temp-log-handler record shared, nominal

with-block[t] t(a temp-log-handler, cb mut t(void))

Temporarily replaces the log handler.

Only applies within this task. Even if you launch a task inside with-log-handler,
that task will still have the default log handler.

get-log-handler shared void(logged)()

This gets the current log handler.
This is useful if you want to use with-log-handler to add a little extra information,
then fall back to the original log handler.

If you just want to call the curent log handler, you could just use log.

log-level enum

  • debug
  • info
  • warn
  • error

Log severity.
The log handler can use this any way it wants.
The default log handler just prints the level at the beginning of each log.

logged record nominal

Represents a single call to log.

log-handler alias

Function that handles a log message.

For example, this might write it to the console.