pub struct EZLogConfig {Show 14 fields
pub level: Level,
pub version: Version,
pub dir_path: String,
pub name: String,
pub file_suffix: String,
pub trim_duration: Duration,
pub max_size: u64,
pub compress: CompressKind,
pub compress_level: CompressLevel,
pub cipher: CipherKind,
pub cipher_key: Option<Vec<u8>>,
pub cipher_nonce: Option<Vec<u8>>,
pub rotate_duration: Duration,
pub extra: Option<String>,
}Expand description
A config to set up EZLogger
Fields§
§level: Levelmax log level
if record level is greater than this, it will be ignored
version: VersionEZLog version
logger version, default is Version::V2
dir_path: StringLog file dir path
all log files will be saved in this dir
name: StringLog name to identify the EZLogger
log file name will be log_name + file_suffix
file_suffix: StringLog file suffix
file suffix, default is [DEFAULT_LOG_FILE_SUFFIX]
trim_duration: DurationLog file expired after duration
the duration after which the log file will be trimmed
max_size: u64The maxium size of log file
if log file size is greater than this, logger will rotate the log file
compress: CompressKindLog content compress kind.
compress_level: CompressLevelLog content compress level.
compress level, default is CompressLevel::Default
cipher: CipherKindLog content cipher kind.
cipher kind, default is CipherKind::NONE
cipher_key: Option<Vec<u8>>Log content cipher key.
cipher key, default is None
cipher_nonce: Option<Vec<u8>>Log content cipher nonce.
cipher nonce, default is None
rotate_duration: Durationrotate duration
the duration after which the log file will be rotated
extra: Option<String>Extra info to be added to log header
Plaintext infomation write in log file header
Implementations§
Source§impl EZLogConfig
impl EZLogConfig
pub fn is_valid(&self) -> bool
pub fn create_mmap_file(&self) -> Result<(PathBuf, MmapMut), LogError>
pub fn query_log_files_for_date(&self, date: OffsetDateTime) -> Vec<PathBuf>
pub fn check_valid(&self) -> Result<(), LogError>
Trait Implementations§
Source§impl Clone for EZLogConfig
impl Clone for EZLogConfig
Source§fn clone(&self) -> EZLogConfig
fn clone(&self) -> EZLogConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more