Module logging

Module 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§

macros
Logging macros
prelude
Logging prelude

Structs§

LogFileConfig
Settings to enable writing tracing output to files.
LogFileGuard
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_dir may 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§

LogFileError
Error for file logging.
LogFileRotation
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_logging conciseably 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§

BoxedLayer
A boxed [Layer] that can be used with setup_logging.