log_io library

Log writers that depend on dart:io / dart:isolate and therefore do not work on the web. Import this in addition to package:serverpod_shared/serverpod_shared.dart when you need terminal-facing output or isolate-based writers.

Classes

ActiveScope
State for a single in-progress scope with a braille spinner.
ClosedScope
A completed scope record for test assertions.
IsolatedLogWriter
A LogWriter that runs a wrapped writer on a dedicated isolate.
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.
SpinnerLogWriter
A LogWriter base class that manages braille progress spinners.
TestLogWriter
A LogWriter that collects entries and scopes for test assertions.
TextLogWriter
A SpinnerLogWriter that writes formatted text to stdout/stderr.

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

isInteractiveTerminal bool
Whether stdout is an interactive terminal.
getter/setter pair
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

Functions

formatElapsed(Duration d) String
Format a duration for display in spinner/completion lines.

Typedefs

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