#log #performance #high #file

nightly hp-log

try to implement high performance log :w

4 releases

0.3.1 Jul 1, 2019
0.3.0 Mar 31, 2019
0.2.1 Jan 8, 2019
0.2.0 Jan 6, 2019

#570 in Debugging

Apache-2.0

37KB
960 lines

hp-log

high performance multi-thread log implement in rust

Usage

use the newest version from crate.io (recommand)

[dependencies]
hp-log = "0.3.0"

use the newest version by git

[dependencies]
hp-log = {git = "https://github.com/wtu-sos/hp-log.git"}

Config File

# log level filter
# OFF  ERROR  WARN  INFO  DEBUG  TRACE 
global_max_level = "TRACE"
[console_conf]
switch = true  # Whether the output is on the console
debug = true
info = true 
warn = true 
error = true
fatal = true

[file_conf]
switch = true  # Whether to output in the log file 
debug = true
info = true 
warn = true 
error = true
fatal = true

file_log_dir = "/tmp/log/" 
file_temp_buf = "1048576"

Generated Code Example

#![feature(rustc_private)]

extern crate hp_log;
#[macro_use]
extern crate log;

fn main() {
    hp_log::init("./".to_string());
    
    trace!("main running ````````````````````");
    info!("main running info");
    debug!("main running .........................");
    warn!("main running ****************");
    error!("main running +++++++++++++++++++++++++");

    hp_log::close();

}

License

hp-log is distributed under the terms of the Apache License (Version 2.0).

See LICENSE for details.

Copyright 2018 wtu-sos

Dependencies

~1.3–2.5MB
~48K SLoC