Crate cortex_m_log
source ·Expand description
Logging facilities for Cortex-M processors
Destinations
The crate provides following destinations for writes:
- Dummy - noop destination that performs no writes. Useful for release mode
- Itm - Uses Cortex-M Itm to send output. Note that it is available only on ARMv7-M and newer
- Semihosting - Uses Cortex-M Semihosting to send output.
All destinations implements fmt::Write to provide simple and generic interface
Printers
Each destination is provided with corresponding Printer. In addition to providing generic interface it also allows to configure Interrupt mode for all prints. See.
Macros
The crate provide primitieve macros that are enabled only in debug release.
Controlled by debug_assertions
attribute
use cortex_m_log::{print, println, d_print, d_println};
use cortex_m_log::printer::Dummy;
fn main() {
let mut log = Dummy::new();
println!(log, "Some print with newline!");
//Debug version of print that resolves into nothing in release mode
//Note that you must import print macro for it to work
d_print!(log, "Print stuff: {}", "stuff");
//Note that you must import println macro for it to work
d_println!(log, "Print stuff: {} and also newline", "stuff");
}
Modules
- Contains possible destination for writes
- Integration with log
- Crate configuration modes
- Contains possible printers for Cortex-M
Macros
- Deubg print macro that uses Printers to write formatted output
- Deubg print macro that uses Printers to write formatted output with newline
- Print macro that uses Printers to write formatted output
- Print macro that uses Printers to write formatted output with newline