pub struct LoggingConfig {
pub level: String,
pub file_path: Option<String>,
pub enable_console: bool,
pub enable_file: bool,
pub max_file_size_mb: u64,
pub max_files: usize,
}Expand description
日志配置
§热重载支持
✅ 支持热重载 - 所有日志配置项都可以在运行时动态更新。
支持热重载的字段:
level: 日志级别(trace/debug/info/warn/error)file_path: 日志文件路径enable_console: 控制台日志开关enable_file: 文件日志开关max_file_size_mb: 日志文件最大大小max_files: 保留的日志文件数量
注意:文件日志路径更改后,新日志会写入新文件,但不会自动关闭旧文件句柄。
Fields§
§level: StringLog level
file_path: Option<String>Log file path
enable_console: boolWhether to enable console logging
enable_file: boolWhether to enable file logging
max_file_size_mb: u64Maximum log file size (MB)
max_files: usizeNumber of log files to retain
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
Source§impl Default for LoggingConfig
impl Default for LoggingConfig
Source§impl<'de> Deserialize<'de> for LoggingConfig
impl<'de> Deserialize<'de> for LoggingConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LoggingConfig
impl RefUnwindSafe for LoggingConfig
impl Send for LoggingConfig
impl Sync for LoggingConfig
impl Unpin for LoggingConfig
impl UnsafeUnpin 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