#logging #applications #call #another #logged #events #formatted

call_logger

A logger that calls another application for every logged item

12 releases (6 breaking)

0.6.0 Jan 10, 2025
0.5.0 Dec 19, 2024
0.4.0 Dec 16, 2024
0.3.0 Dec 13, 2024
0.0.5 Mar 13, 2023

#257 in Debugging

Download history 3/week @ 2024-10-29 6/week @ 2024-11-05 1/week @ 2024-11-12 6/week @ 2024-11-19 18/week @ 2024-11-26 123/week @ 2024-12-03 265/week @ 2024-12-10 234/week @ 2024-12-17 6/week @ 2024-12-24 162/week @ 2025-01-07 74/week @ 2025-01-14 17/week @ 2025-01-21 29/week @ 2025-01-28 25/week @ 2025-02-04

165 downloads per month
Used in r53-ddns

Apache-2.0

40KB
754 lines

call_logger

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

A logger that calls another application, script or URL for every logged item, passing a 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 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

~2.6–4MB
~71K SLoC