Expand description
ezlog is a high efficiency cross-platform logging library.
It is inspired by Xlog and Loagan, rewrite in Rust.
Guide level documentation is found on the website.
Features
- multi platform: Flutter, Android, iOS, Windows, Linux, MacOS
- map file into memory by mmap.
- compression support, eg: zlib.
- encryption support, eg: AEAD encryption.
- fetch log by callback.
- trim out of date files.
- command line parser support.
example
use ezlog::EZLogConfigBuilder;
use ezlog::Level;
use log::trace;
ezlog::InitBuilder::new().debug(true).init();
let config: ezlog::EZLogConfig = EZLogConfigBuilder::new()
.level(Level::Trace)
.dir_path(
dirs::cache_dir()
.unwrap()
.into_os_string()
.into_string()
.expect("dir path error"),
)
.build();
ezlog::create_log(config);
trace!("hello ezlog");Structs
- A config to set up EZLogger
- The builder of EZLogConfig
- Single Log record
- EZRecord’s builder
- Default EventListener implementation, print every event in console
- Fetch Logs file‘s path reqeust
- Fetch Logs file‘s path result.
- EZLog file Header
- InitBuilder is used to init ezlog
Enums
- Cipher kind current support
- Compress type can be used to compress the log file.
- Compress level
- EZLog Event Listener
- Log level, used to filter log records
- Log version enum
Constants
- A EZLogger default name. current is “default”.
- Log file fixed header length.
Traits
- The Compression trait + Decompression trait
- The Logger struct to implement the Log encode. Compress function abstract
- The Encryptor trait + Decryptor trait
- Decompress function abstract
- decrypt function abstract
- Async callback for fetch log files
- Encrypt function abstract
Functions
- Create a new EZLogger from an EZLogConfig
- Force flush the log file
- Flush all log files
- initDeprecatedInit ezlog
- init_with_eventDeprecated
- Write a EZRecord to the log file
- Request logs file path array at the date which EZLogger’s name is define in the parameter
- Set the boxed EZLogCallback
- Set global EventListener
- Trim all EZLoggers outdated files