Skip to main content

Module logs

Module logs 

Source
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 Write adapter that reformats systemg log bytes into the selected output mode line by line, optionally stripping ANSI escapes and dropping chrome.
PruneSummary
Summary of the files removed by a prune run.
RotatingLogWriter
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, or 30m into seconds.
parse_byte_size
Parses a human-friendly byte size such as 500MB, 2g, or 1048576.
parse_time_bound
Parses a --since / --until bound into an absolute UTC instant.
prefix_lines_with_service
Prefixes every line of chunk with 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 .log files 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 keep omits.
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 n content 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.