Skip to main content

init_logging

Function init_logging 

Source
pub fn init_logging(config: LogConfig) -> Result<()>
Expand description

Initialize logging subsystem

§Arguments

  • config - Logging configuration

§Examples

use starla_common::logging::{init_logging, LogConfig};

// Default: stdout with info level
init_logging(LogConfig::default()).unwrap();

// With custom log directory
let config = LogConfig {
    log_dir: Some("/var/log/starla".into()),
    level: "debug".to_string(),
    json_format: false,
};
init_logging(config).unwrap();