log library

Log primitives and global loggers. Names like log, logWriter, LogLevel, and LogScope are intentionally kept off the main serverpod_shared barrel because they collide with common user identifiers; import this library when you need them.

Classes

ClosedScope
A completed scope record for test assertions.
Log
A logger that delegates to a LogWriter and resolves the current LogScope from the Zone.
LogEntry
A single log entry. Always belongs to a LogScope.
LogScope
A scoped operation. Scopes form a tree - every scope has a parent except the root scope.
LogWriter
Transport layer for log output. Implementations decide where logs go (terminal, database, VM service, TUI, etc.).
MultiLogWriter
A LogWriter that fans out to multiple child writers.
TestLogWriter
A LogWriter that collects entries and scopes for test assertions.

Enums

LogLevel
Log severity level.

Extensions

LogConvenience on Log
Convenience methods for common log levels.
LogScoping on Log
Scope management: progress operations and manual scope control.

Properties

log Log
Global Log that forwards to logWriter. Identity is stable: the instance is constructed at library init and never reassigned. Entry points configure logging by mutating logWriter, not by replacing log.
final
logWriter MultiLogWriter
Global writer chain that backs log. Callers configure the chain by adding writers with MultiLogWriter.add and removing them with MultiLogWriter.remove; identity is stable for the process lifetime, so the chain is shared across any number of Log consumers and framework bootstraps.
final

Typedefs

LogEntryFactory = FutureOr<LogEntry> Function()
A factory function that creates a LogEntry.