Expand description
The logging framework for Nautilus systems.
This module implements a high-performance logging subsystem that operates in a separate thread
using an MPSC channel for log message delivery. The system uses reference counting to track
active LogGuard
instances, ensuring the logging thread completes all pending writes before
termination.
§LogGuard Reference Counting
The logging system maintains a global count of active LogGuard
instances using an atomic
counter (LOGGING_GUARDS_ACTIVE
). When a LogGuard
is created, the counter is incremented,
and when dropped, it’s decremented. When the last LogGuard
is dropped (counter reaches zero),
the logging thread is properly joined to ensure all buffered log messages are written to their
destinations before the process terminates.
The system supports a maximum of 255 concurrent LogGuard
instances. Attempting to create
more will cause a panic.
Re-exports§
pub use macros::log_debug;
pub use macros::log_error;
pub use macros::log_info;
pub use macros::log_trace;
pub use macros::log_warn;
Modules§
- headers
- logger
- macros
- Colored logging macros for enhanced log output with automatic color mapping.
- writer
Constants§
Functions§
- init_
logging - Initialize logging.
- init_
tracing - Initialize tracing.
- log_
task_ aborted - Logs that a task was aborted using
tracing::debug!
. - log_
task_ awaiting - Logs that a task is being awaited using
tracing::debug!
. - log_
task_ error - Logs that there was an error in a task
tracing::error!
. - log_
task_ started - Logs that a task has started using
tracing::debug!
. - log_
task_ stopped - Logs that a task has stopped using
tracing::debug!
. - logging_
clock_ set_ realtime_ mode - Sets the global logging clock to real-time mode.
- logging_
clock_ set_ static_ mode - Sets the global logging clock to static mode.
- logging_
clock_ set_ static_ time - Sets the global logging clock static time with the given UNIX timestamp (nanoseconds).
- logging_
is_ colored - Returns whether the core logger is using ANSI colors.
- logging_
is_ initialized - Returns whether the core logger is enabled.
- logging_
set_ bypass - Sets the logging subsystem to bypass mode.
- logging_
shutdown - Shuts down the logging subsystem.
- map_
log_ level_ to_ filter - parse_
component_ levels - Parses component-specific log levels from a JSON value map.
- parse_
level_ filter_ str - Parses a string into a
LevelFilter
.