1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! Logging module using the `log` crate.
//!
//! This module provides logging functionality for the library when the `std` feature is enabled.
//!
//! # Usage
//!
//! Initialize the logger in your application using your preferred logger implementation
//! that implements the `log` crate's `Log` trait (e.g., `env_logger`, `tracing`, `simplelog`).
//!
//! # Environment Variables
//!
//! - `RUST_LOG`: Controls log level (when using env_logger or similar)
//!
//! # Example
//!
//! ```bash
//! RUST_LOG=debug cargo run --example basic_usage
//! ```
use LevelFilter;
/// Initialize the logger with default settings.
///
/// This function is a no-op. Use a logger implementation that supports the `log` crate.
///
/// For env_logger compatibility, users should use `env_logger::init()` directly.
/// Initialize the logger with a specific filter.
///
/// Arguments:
///
/// * `filter`: Log level filter string (e.g., "debug", "info", "warn", "error")
///
/// # Example
///
/// ```rust
/// use rat_trig_rs::logging::init_logger_with_filter;
/// init_logger_with_filter("debug");
/// ```
/// Try to initialize the logger, returning an error if already initialized.
///
/// This is useful when you want to initialize the logger conditionally
/// without panicking if it's already been initialized.
/// Initialize the logger with a custom filter and try_init behavior.
///
/// Arguments:
///
/// * `filter`: Log level filter string
///
/// Returns:
///
/// `Ok(())` if initialization succeeded, `Err` if logger was already initialized
/// Check if the logger is currently active.
///
/// This can be used to conditionally enable expensive logging operations.