pub struct LoggingConfig {
pub level: Level,
pub logging_enabled: bool,
pub logger_name: String,
pub log_path: Option<PathBuf>,
pub _tracing_guard: Option<Arc<DefaultGuard>>,
pub build_log: bool,
}Expand description
Configuration for the logging system.
Manages log levels, file output, and logger initialization.
Fields§
§level: LevelLog level threshold (ERROR, WARN, INFO, DEBUG, TRACE)
logging_enabled: boolWhether logging is enabled
logger_name: StringName used to identify this logger in output
log_path: Option<PathBuf>Custom path for log files. If None, uses default path
_tracing_guard: Option<Arc<DefaultGuard>>Guard for the tracing subscriber
build_log: boolWhether this is a build log
Implementations§
Source§impl LoggingConfig
impl LoggingConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new LoggingConfig with default settings.
Defaults to:
- INFO level
- Logging enabled
- “llm_interface” logger name
- Default log path
Sourcepub fn load_logger(&mut self) -> Result<()>
pub fn load_logger(&mut self) -> Result<()>
Initializes and starts the logger with the current configuration.
If logging is enabled, creates log files and sets up console output. Logs are rotated hourly and up to 6 files are kept.
§Errors
Returns error if:
- Log directory creation fails
- File appender creation fails
Trait Implementations§
Source§impl Clone for LoggingConfig
impl Clone for LoggingConfig
Source§fn clone(&self) -> LoggingConfig
fn clone(&self) -> LoggingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoggingConfig
impl Debug for LoggingConfig
Auto Trait Implementations§
impl Freeze for LoggingConfig
impl !RefUnwindSafe for LoggingConfig
impl Send for LoggingConfig
impl Sync for LoggingConfig
impl Unpin for LoggingConfig
impl !UnwindSafe for LoggingConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more