Skip to main content

Module logging

Module logging 

Source
Expand description

Logging module - available when std feature is enabled. Logging module for physdes-rs.

This module provides optional logging capabilities when the std feature is enabled. It uses env_logger for flexible logging configuration via environment variables.

§Usage

use physdes::logging::init_logger;

fn main() {
    init_logger();
    log::info!("Application started");
}

§Environment Variables

  • RUST_LOG: Controls log level (debug, info, warn, error)
  • RUST_LOG_STYLE: Controls colored output

Example:

RUST_LOG=debug cargo run --features std

Functions§

init_logger
Initialize the logger with default filter (info).
init_logger_with_filter
Initialize the logger with a custom filter string.
is_logger_initialized
Check if the logger has been initialized.
try_init_logger
Try to initialize the logger with default filter (info).
try_init_logger_with_filter
Try to initialize the logger with a custom filter string.