31 lines
596 B
Rust
31 lines
596 B
Rust
// src/log.rs (or log/mod.rs)
|
|
#[cfg(feature = "defmt")]
|
|
pub use defmt::{debug, error, info, trace, warn};
|
|
|
|
#[cfg(not(feature = "defmt"))]
|
|
mod no_defmt {
|
|
#[macro_export]
|
|
macro_rules! trace {
|
|
($($t:tt)*) => {};
|
|
}
|
|
#[macro_export]
|
|
macro_rules! debug {
|
|
($($t:tt)*) => {};
|
|
}
|
|
#[macro_export]
|
|
macro_rules! info {
|
|
($($t:tt)*) => {};
|
|
}
|
|
#[macro_export]
|
|
macro_rules! warn {
|
|
($($t:tt)*) => {};
|
|
}
|
|
#[macro_export]
|
|
macro_rules! error {
|
|
($($t:tt)*) => {};
|
|
}
|
|
}
|
|
|
|
#[cfg(not(feature = "defmt"))]
|
|
pub use no_defmt::*;
|