Module logging

Module logging 

Source
Expand description

Logging configuration with configurable verbosity.

This module provides a flexible logging system with configurable verbosity levels and filtering capabilities.

§Features

  • Multiple verbosity levels (Error, Warn, Info, Debug, Trace)
  • Module-level filtering
  • Structured logging support
  • Performance metrics logging
  • Conditional compilation for zero-cost when disabled

§Example

use chie_core::logging::{LogConfig, LogLevel, Logger};

// Create a logger with Info level
let config = LogConfig {
    level: LogLevel::Info,
    include_timestamps: true,
    include_module_path: true,
    include_line_numbers: false,
    filter_modules: vec![],
};

let logger = Logger::new(config);

// Log messages at different levels
logger.info("chie_core::storage", "Storage initialized");
logger.debug("chie_core::cache", "Cache size: 1024 entries");
logger.error("chie_core::network", "Connection failed");

Structs§

LogConfig
Logging configuration.
Logger
Logger instance with configuration.

Enums§

LogLevel
Log verbosity levels.