Module bones_framework::logging
source · 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§
- Logging macros
- Logging prelude
Structs§
- Settings to enable writing tracing output to files.
- Guard for file logging thread, this should be held onto for duration of app, if dropped writing to log file will stop.
- Path to save log files.
LogPath::find_app_data_dir
may be used to to automatically find OS appropriate app data path from app namespace strings, e.g. (“org”, “fishfolk”, “jumpy”) - Plugin to enable tracing. Configures global tracing subscriber.
Enums§
- Error for file logging.
- How often to rotate log file.
Functions§
- Setup the global tracing subscriber, add hook for tracing panics, and optionally enable logging to file system.
- Helper to call
setup_logging
conciseably with reasonable defaults for logging to console and file system. - Panic hook that sends panic payload to [
tracing::error
], and backtrace if available.
Type Aliases§
- A boxed [
Layer
] that can be used withsetup_logging
.