[][src]Crate oysterpack_log

Standardizes logging for the OysterPack platform on top of log. Given a LogConfig, this crate will know how to initialize the logging system and how to shut it down.

#[macro_use]
extern crate oysterpack_app_metadata_macros;

op_build_mod!();

fn main() {
    let app_build = build::get();
    oysterpack_log::init(log_config(),&app_build);
    // The LogConfig used to initialize the log system can be retrieved.
    // This enables the LogConfig to be inspected.
    let log_config = oysterpack_log::config().unwrap();

    run();

    oysterpack_log::shutdown();
}

/// This should be loaded from the app's configuration.
/// For this simple example, we are simply using the default LogConfig.
/// The default LogConfig sets the root log level to Warn and logs to stdout.
fn log_config() -> oysterpack_log::LogConfig {
    Default::default()
}

fn run() {}

Re-exports

pub extern crate log;
pub use config::LogConfig;
pub use manager::config;
pub use manager::init;
pub use manager::shutdown;

Modules

config

Log config

manager

This module is the anchor point for configuring and initializing the log system.

Macros

debug

Logs a message at the debug level.

error

Logs a message at the error level.

info

Logs a message at the info level.

log

The standard logging macro.

log_enabled

Determines if a message logged at the specified level in that module will be logged.

trace

Logs a message at the trace level.

warn

Logs a message at the warn level.

Enums

Level

An enum representing the available verbosity levels of the logger.

LevelFilter

An enum representing the available verbosity level filters of the logger.