Skip to main content

Module logging

Module logging 

Source
Expand description

Global unlost logging with daily rotation.

Logs are stored in the unlost data directory (~/.unlost/logs/) as daily rotating files. All unlost instances share the same log files, making debugging easier.

Structs§

LogGuard
A guard that must be kept alive for the duration of the program to ensure logs are flushed. When dropped, the non-blocking writer will flush remaining logs.

Functions§

create_filter
Create a filter for unlost logs at the given level, keeping dependencies quiet.
init_logging
Initialize logging to both stderr and a file in the unlost data directory. Returns a guard that must be kept alive for the duration of logging.
init_logging_file_only
Initialize logging to file only (no stderr). Useful for shims/companions where stdout/stderr are used for protocol communication.