Expand description
Log streaming. Module for managing and displaying logs of system services.
Service output is captured into one canonical per-service log, with each line tagged by capture timestamp and source stream.
Structs§
- LogFilter
- Post-capture filter applied to persisted log lines before display.
- LogManager
- Initializes logging for a service by spawning threads to write stdout and stderr to log files.
- LogWriter
- A
Writeadapter that reformats systemg log bytes into the selected output mode line by line, optionally stripping ANSI escapes and dropping chrome. - Prune
Summary - Summary of the files removed by a prune run.
- Rotating
LogWriter - Shared, rotation-aware writer for the supervisor’s own tracing output.
Enums§
- LogFormat
- Output rendering mode for displayed log lines.
- LogSection
- High-level bucket for all-services log rendering.
Constants§
- SERVICE_
MARKER_ PREFIX - Prefix of the control line the supervisor emits before a service’s bytes so
downstream readers can attribute lines to the right unit. Begins with an
ASCII record separator (
0x1e) so it never collides with captured output.
Functions§
- cancel_
log_ pipe_ handoff - Restores close-on-exec and resumes readers after a failed exec attempt.
- clear_
live_ log - Drops the in-memory live-log buffer for every stream of a project’s service.
- clear_
project_ live_ logs - Drops the in-memory live-log buffers for every service of a project.
- get_
log_ path - Returns the legacy path to the log file for a given project, service and kind.
- get_
service_ log_ path - Returns the path to the canonical service log file for a project.
- parse_
age_ seconds - Parses a human-friendly duration such as
7d,12h, or30minto seconds. - parse_
byte_ size - Parses a human-friendly byte size such as
500MB,2g, or1048576. - parse_
time_ bound - Parses a
--since/--untilbound into an absolute UTC instant. - prefix_
lines_ with_ service - Prefixes every line of
chunkwith its service name. - prepare_
log_ pipe_ handoff - Pauses log readers, flushes canonical writers, and makes retained pipe descriptors inheritable by the replacement supervisor.
- prune_
logs - Prunes rotated log files by age and total size, keeping active
.logfiles intact. - resolve_
log_ path - Attempts to resolve an on-disk log path for the given service and kind, falling back to the canonical location when no existing file can be found.
- resume_
log_ pipe_ handoff - Rebuilds managed log readers from descriptors inherited across re-exec.
- retain_
project_ live_ logs - Drops the live-log buffers of a project’s services that
keepomits. - rotated_
history_ paths - Returns a service’s active log path followed by its rotated backups, ordered oldest to newest, for full-history reads.
- service_
log_ handoff_ ready - Returns whether both managed file-log streams can survive supervisor re-exec.
- service_
marker_ line - Builds the per-service marker line the supervisor writes before streaming a unit’s captured bytes.
- spawn_
dynamic_ child_ log_ writer - Spawns a thread to capture and log output from dynamically spawned child processes.
- spawn_
log_ writer - Starts a canonical single-stream service log pipeline.
- spawn_
log_ writer_ with_ config - Starts a single-stream writer with explicit rotation settings.
- spawn_
managed_ service_ log_ writers - Starts re-exec-aware log capture for a newly spawned managed service.
- spawn_
service_ log_ writers - Starts the canonical writer and available stream readers for a service.
- strip_
ansi - Removes ANSI escape sequences (CSI and simple two-byte escapes) from bytes.
- supervisor_
log_ path - Returns the path to the supervisor’s own log file.
- tail_
service_ log - Returns the last
ncontent lines of a service’s log, ANSI-stripped and with the<timestamp> <stream>prefix removed, for use as diagnostic evidence. Returns an empty vec when the log is missing or unreadable. - tail_
service_ log_ since - Returns recent diagnostic evidence captured at or after one service generation began.
- validate_
service_ name - Rejects a service name that could escape the log directory.
- write_
log_ section_ header - Writes a section header used by the all-services log view.