#rtt #logger #cortex-m #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

#1604 in Embedded development

Download history 192/week @ 2024-07-24 306/week @ 2024-07-31 340/week @ 2024-08-07 448/week @ 2024-08-14 261/week @ 2024-08-21 351/week @ 2024-08-28 363/week @ 2024-09-04 308/week @ 2024-09-11 317/week @ 2024-09-18 239/week @ 2024-09-25 249/week @ 2024-10-02 182/week @ 2024-10-09 201/week @ 2024-10-16 165/week @ 2024-10-23 142/week @ 2024-10-30 126/week @ 2024-11-06

654 downloads per month
Used in 4 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

~725KB