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
//! # rslog
//!
//! A lightweight logging library for Rust built entirely using the standard library with zero external dependencies.
//!
//! ## Features
//!
//! - **Zero Dependencies**: Pure standard library implementation
//! - **Multiple Log Levels**: Trace, Debug, Info, Warn, Error, Critical
//! - **Multiple Output Targets**: Console and file output simultaneously
//! - **Async Writing**: Background thread for non-blocking file writes
//! - **Log Rotation**: Size-based and time-based rotation support with optional gzip compression
//! - **Log Filtering**: Per-module log level overrides (with `set_module_level`)
//! - **Formatting Macros**: `trace!`, `debug!`, `info!`, `warn!`, `error!`, `critical!` with `format!`-style syntax
//! - **Multiple Output Formats**: Text, JSON, and custom patterns
//! - **Configurable**: Flexible configuration options via `ConfigBuilder`
//!
//! ## Quick Start
//!
//! ```rust
//! use rslog::{Logger, LogLevel};
//!
//! // Get the logger instance
//! let logger = Logger::get_instance();
//!
//! // Log messages
//! logger.info("Application started");
//! logger.debug("Debug message");
//! logger.warn("Warning message");
//! logger.error("Error message");
//! logger.critical("Critical error");
//! ```
//!
//! ## Custom Configuration
//!
//! ```rust
//! use rslog::{Logger, LogLevel, ConfigBuilder, OutputFormat};
//!
//! let config = ConfigBuilder::new()
//! .log_dir("logs")
//! .file_prefix("app_")
//! .level(LogLevel::Info)
//! .output_format(OutputFormat::Json)
//! .build();
//!
//! Logger::init_with_config(config);
//! let logger = Logger::get_instance();
//! logger.info("Hello, world!");
//! ```
//!
//! ## Per-Module Log Filtering
//!
//! ```rust
//! use rslog::{Logger, ConfigBuilder, LogLevel, LogFilter};
//!
//! let mut filter = LogFilter::new();
//! filter.set_module_level("network", LogLevel::Error);
//! filter.set_module_level("database", LogLevel::Trace);
//!
//! let config = ConfigBuilder::new()
//! .level(LogLevel::Warn)
//! .filter(filter)
//! .build();
//!
//! Logger::init_with_config(config);
//! let logger = Logger::get_instance();
//!
//! // Or set module levels at runtime:
//! // logger.set_module_level("http", LogLevel::Debug);
//! ```
//!
//! ## Log Rotation & Compression
//!
//! ```rust
//! use rslog::{Logger, ConfigBuilder, RotationStrategy, RotatorConfig};
//!
//! let config = ConfigBuilder::new()
//! .rotation(RotatorConfig {
//! strategy: RotationStrategy::SizeBased(10 * 1024 * 1024), // 10MB
//! max_files: 5,
//! compress_old_files: true, // gzip-compress rotated files
//! })
//! .build();
//!
//! Logger::init_with_config(config);
//! ```
pub use LogLevel;
pub use Logger;
pub use Config;
pub use ConfigBuilder;
pub use OutputFormat;
pub use ;
pub use LogEntry;
pub use ;
pub use LogFilter;