Expand description
Logging module for bones. Provides implementation of global tracing subscriber and panic hook.
Enabled with feature “logging”. See docs of setup_logging for details + usage.
Re-exports§
pub use macros::setup_logs;
Modules§
Structs§
- LogFile
Config - Settings to enable writing tracing output to files.
- LogFile
Guard - Guard for file logging thread, this should be held onto for duration of app, if dropped writing to log file will stop.
- LogPath
- Path to save log files.
LogPath::find_app_data_dirmay be used to to automatically find OS appropriate app data path from app namespace strings, e.g. (“org”, “fishfolk”, “jumpy”) - LogSettings
- Plugin to enable tracing. Configures global tracing subscriber.
Enums§
- LogFile
Error - Error for file logging.
- LogFile
Rotation - How often to rotate log file.
Functions§
- setup_
logging - Setup the global tracing subscriber, add hook for tracing panics, and optionally enable logging to file system.
- setup_
logging_ default - Helper to call
setup_loggingconciseably with reasonable defaults for logging to console and file system. - tracing_
panic_ hook - Panic hook that sends panic payload to [
tracing::error], and backtrace if available.
Type Aliases§
- Boxed
Layer - A boxed [
Layer] that can be used withsetup_logging.