doric 0.1.0

A highly simple asynchronous logging lib for Rust.
Documentation
  • Coverage
  • 1.52%
    1 out of 66 items documented1 out of 33 items with examples
  • Size
  • Source code size: 20.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.89 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 20s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • inkhare

doric

A highly simple asynchronous logging lib for Rust

Quick Start

To use doric, add the dependencies to your Cargo.toml

[dependencies]
doric = { git = 'https://github.com/inkhare/doric', branch = 'main' }

Testing:

    cargo run --example test

Example

use doric::config;
use log::{info, error};
use std::{thread, time};

fn simple_log() {
    let conf = config::Config {
        path: "./log".to_string(),
        max_size: 2,
        max_segments: 3,
        interval: 10,
        level: doric::Info,
        log_type: doric::File,
    };

    config::init_config(&conf);
    let delay = time::Duration::from_millis(10);
    thread::sleep(delay);

    error!("error log test{:?}", 9090);
}

NOTE

This library is verified to work in rustc 1.51.0 (nightly), and the support of other versions needs more testing.