#logger #rtt #cortex-m #platform #rtt-target

rtt-logger

An rtt-target logger implementation for Cortex-M embedded platforms

4 releases (2 breaking)

0.3.0 Oct 30, 2023
0.2.1 Feb 17, 2023
0.2.0 Feb 7, 2022
0.1.0 Sep 17, 2020

#453 in Embedded development

Download history 50/week @ 2023-12-18 38/week @ 2023-12-25 36/week @ 2024-01-01 84/week @ 2024-01-08 169/week @ 2024-01-15 111/week @ 2024-01-22 141/week @ 2024-01-29 102/week @ 2024-02-05 204/week @ 2024-02-12 151/week @ 2024-02-19 209/week @ 2024-02-26 275/week @ 2024-03-04 133/week @ 2024-03-11 140/week @ 2024-03-18 270/week @ 2024-03-25 363/week @ 2024-04-01

931 downloads per month
Used in 5 crates

Apache-2.0

6KB

crates.io crates.io

rtt-logger

Plain RTT Logger implementation

Documentation

License

Licensed under

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.


lib.rs:

A logger implementation to use RTT with the Rust log crate.

use log::{info, LevelFilter};
use rtt_logger::RTTLogger;
use rtt_target::rtt_init_print;

// logger configuration
const LOG_LEVEL: LevelFilter = LevelFilter::Info;
static LOGGER: RTTLogger = RTTLogger::new(LOG_LEVEL);

fn main() {
    // logger setup
    rtt_init_print!();
    log::set_logger(&LOGGER)
        .map(|()| log::set_max_level(LOG_LEVEL))
        .unwrap();

    // logger usage in main binary or in any library
    info!("Hello World!");
}

Dependencies

~710KB