#logging

call_logger

A logger that calls another application for every logged item

5 releases

0.0.5 Mar 13, 2023
0.0.4 Mar 13, 2023
0.0.3 Mar 13, 2023
0.0.2 Mar 7, 2023
0.0.1 Mar 7, 2023

#252 in Debugging

Download history 108/week @ 2023-03-07 81/week @ 2023-03-14 17/week @ 2023-03-21 13/week @ 2023-03-28 19/week @ 2023-04-04 38/week @ 2023-04-11 33/week @ 2023-04-18 4/week @ 2023-04-25 19/week @ 2023-05-02 19/week @ 2023-05-09 12/week @ 2023-05-16

62 downloads per month

Apache-2.0

13KB
216 lines

call_logger

Crates.io Crates.io Build Status docs.rs dependency status

A logger that calls another application for every logged item, passing a json formatted string that contains the details of the log event.

Usage

Use of the builder model to set up the logger to call a script called store_log:

use call_logger::CallLogger;
use log::LevelFilter;

fn main() {
    let _ = CallLogger::new()
        .with_level(LevelFilter::Info)
        .with_call_target("store_log".to_string())
        .with_local_timestamp()
        .init();
    log::info!("Hello logging world")
}

Features

  • timestamps - add a timestamp to the output

Contribute

This is just an early attempt at a general purpose logger that calls out to another process. If you have any ideas for missing features, please raise an issue or a PR.

Dependencies

~0–26MB
~416K SLoC