Open
Description
The std::dbg!()
macro is quite useful for quick debugging. I have stumbled across at least a handful of cases where whatever the logger is is more useful than stderr output - for example, when the logger is mapped to RTT or UART on embedded and there is no stderr available.
So, my suggestion is to add ldbg
that acts similarly to the debug macro, but uses the default logger.
use log::{ldbg, Level};
let v = vec![0usize, 1, 2, 3, 4];
// default to debug level (possibly warn or info so it's more likely to show up)
let m = ldbg!(&v[2..]);
// allow for optional level override
let n = ldbg!(level: Level::Warn, &v[..3]);
Metadata
Assignees
Labels
No labels