Skip to content

Search

Documentation

log

The info, warn and error levels a script writes at, and the buffer behind them. Lines go through the engine's own tracing stream.

On this page

The info, warn and error levels a script writes at, and the buffer behind them. Lines go through the engine's own tracing stream.

7 functions, 0 constants. Scripts reach it as log::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

function acts on what it does
clear() — Empty the buffer, so a console reading it starts again from nothing.
error(string) — Write a line at error level, tagged as coming from a script.
file() -> str? — The file this run's log is written to, or nil when it keeps none. [log] file turns it off and [log] keep says how many past runs stay beside it.
info(string) — Write a line at info level, tagged as coming from a script.
print(string) — Write a line to standard output as it stands, with no level or tag and not into the buffer: what a headless run prints for a tool to read.
since(int?) -> log::Batch — What was logged after cursor (a seq, 0 for all the buffer holds), as { entries, cursor, missed }: pass cursor back next time, and missed counts lines the buffer dropped before they were read. A script hears that there is more with events::listen(this.node, "logged"), as on_logged(total), rather than asking every frame.
warn(string) — Write a line at warning level, tagged as coming from a script.

Are you sure?