eculocate

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

logging.rs (729B)


      1 macro_rules! debug {
      2     ($($arg:tt)*) => {
      3         #[cfg(feature = "defmt")]
      4         defmt::debug!($($arg)*);
      5         #[cfg(feature = "log")]
      6         log::debug!($($arg)*);
      7     };
      8 }
      9 
     10 macro_rules! info {
     11     ($($arg:tt)*) => {
     12         #[cfg(feature = "defmt")]
     13         defmt::info!($($arg)*);
     14         #[cfg(feature = "log")]
     15         log::info!($($arg)*);
     16     };
     17 }
     18 
     19 macro_rules! warn {
     20     ($($arg:tt)*) => {
     21         #[cfg(feature = "defmt")]
     22         defmt::warn!($($arg)*);
     23         #[cfg(feature = "log")]
     24         log::warn!($($arg)*);
     25     };
     26 }
     27 
     28 macro_rules! error {
     29     ($($arg:tt)*) => {
     30         #[cfg(feature = "defmt")]
     31         defmt::error!($($arg)*);
     32         #[cfg(feature = "log")]
     33         log::error!($($arg)*);
     34     };
     35 }