Skip to content
Snippets Groups Projects
macros.rs 660 B
Newer Older
  • Learn to ignore specific revisions
  • #[cfg(feature = "debug")]
    #[macro_export]
    macro_rules! debugln {
        ($($rest:tt)*) => {
    
    João Magalhães's avatar
    João Magalhães committed
            {
                std::print!("[DEBUG] ");
                std::println!($($rest)*);
            }
    
        }
    }
    
    #[cfg(not(feature = "debug"))]
    #[macro_export]
    macro_rules! debugln {
        ($($rest:tt)*) => {
            ()
    
    #[cfg(feature = "pedantic")]
    #[macro_export]
    macro_rules! warnln {
        ($($rest:tt)*) => {
            {
                panic!($($rest)*);
            }
        }
    }
    
    #[cfg(not(feature = "pedantic"))]
    
    #[macro_export]
    macro_rules! warnln {
        ($($rest:tt)*) => {
            {
                std::print!("[WARNING] ");
                std::println!($($rest)*);
            }
        }
    }