13 releases

0.2.1-alpha.1 Nov 7, 2023
0.2.0-beta.2 Aug 7, 2023
0.2.0-beta.1 Jul 23, 2023
0.1.7 Nov 24, 2022
0.1.4 Jul 25, 2022

#11 in #log-error

Download history 25/week @ 2024-09-22 10/week @ 2024-09-29

59 downloads per month
Used in 2 crates

MIT/Apache

150KB
4K SLoC

Rust Usage

Add ezlog

Add this to your Cargo.toml

[dependencies]
ezlog = "0.2"

Example

use ezlog::EZLogConfigBuilder;
use ezlog::Level;
use log::{error, info, warn};
use log::{LevelFilter, Log};

ezlog::InitBuilder::new().init();

let config = EZLogConfigBuilder::new()
        .level(Level::Trace)
        .dir_path(
            dirs::download_dir()
                .unwrap()
                .into_os_string()
                .into_string()
                .expect("dir path error"),
        )
        .build();
ezlog::create_log(config);

info!("hello ezlog");

see more examples in examples dir.


lib.rs:

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");

Dependencies

~3–46MB
~668K SLoC