Crate lum_log

Crate lum_log 

Source
Expand description

lum_log is a simple wrapper around log4rs offering easy setup and convenience macros. It provides a simplified builder for log4rs configurations. Furthermore, it provides logging macros that fall back to stdout/stderr if the logger is not set up yet.

Re-exports§

pub use builder::ConfigBuilder;
pub use builder::ConfigBuilderError;
pub use logger::is_set_up;
pub use logger::setup;
pub use lum_libs::log;
pub use lum_libs::log4rs;

Modules§

builder
Defines the ConfigBuilder for building log4rs configurations.
default
Defines some defaults that help setting up logging.
logger
Defines functions to set up the logger.
macros
Defines convenience logging macros.

Macros§

debug
Logs a message at the debug level. If the logger is not set up, the message is printed to stdout. This macro uses a Mutex under the hood, so do not use it in performance-critical code.
error
Logs a message at the error level. If the logger is not set up, the message is printed to stderr. This macro uses a Mutex under the hood, so do not use it in performance-critical code.
error_panic
Calls the error! macro and then panics by using the panic! macro with the same message. This macro uses a Mutex under the hood, so do not use it in performance-critical code.
error_unreachable
Calls the error! macro and then panics by using the unreachable! macro with the same message. This macro uses a Mutex under the hood, so do not use it in performance-critical code.
info
Logs a message at the info level. If the logger is not set up, the message is printed to stdout. This macro uses a Mutex under the hood, so do not use it in performance-critical code.
trace
Logs a message at the trace level. If the logger is not set up, the message is printed to stdout. This macro uses a Mutex under the hood, so do not use it in performance-critical code.
warn
Logs a message at the warn level. If the logger is not set up, the message is printed to stdout. This macro uses a Mutex under the hood, so do not use it in performance-critical code.