Skip to main content

Module log

Module log 

Source
Expand description

The engine’s log (ADR-0030): lines with a level, a category and the frame they were given in, kept in a LogRing of the last LOG_LINES.

A screen or the engine logs through Ctx::log; the platform’s App takes the lines each frame, stamps them with its frame and keeps them for tests, tools and the backend’s sinks. A log is output only: nothing reads it to decide anything. Its lines are English, never translated, and not player text.

Structs§

LogFilter
Which lines a log keeps: a level for every category, and a level per category over it. A line passes at its category’s level or more serious.
LogLine
One line of the log. Build it with LogLine::new (ADR-0039).
LogRing
The last lines of a log, oldest first, and how many older ones were dropped. Each line pushed gets a sequence number, from 0 and never reused, so a reader takes the lines since the last it took.

Enums§

LogCategory
What part of the engine or game a line is about.
LogLevel
How serious a line is, from the most serious: Error < Debug.

Constants§

LOG_LINES
How many lines a log keeps: older ones are dropped and counted.