Files @ 36cc1fe490f7
Branch filter:

Location: CSY/reowolf/src/macros.rs - annotation

36cc1fe490f7 856 B application/rls-services+xml Show Source Show as Raw Download as Raw
MH
Merge branch 'feat-api-cmds-and-branching'

Implements the programmer-facing API to allow programmatic
specification of a synchronous round. The way in which these put/get
interactions are performed is in an initial shape. Perhaps this will
change in the future.

The second main set of changes is the addion of a 'fork' statement,
which allows explicit forking, and allowing multiple puts/gets over the
same transport link within a single sync round.
macro_rules! enabled_debug_print {
    (false, $name:literal, $format:literal) => {};
    (false, $name:literal, $format:literal, $($args:expr),*) => {};
    (true, $name:literal, $format:literal) => {
        println!("[{}] {}", $name, $format)
    };
    (true, $name:literal, $format:literal, $($args:expr),*) => {
        println!("[{}] {}", $name, format!($format, $($args),*))
    };
}

/*
Change the definition of these macros to control the logging level statically
*/

macro_rules! log {
    (@ENDPT, $logger:expr, $($arg:tt)*) => {{
        // if let Some(w) = $logger.line_writer() {
        //     let _ = writeln!(w, $($arg)*);
        // }
    }};
    ($logger:expr, $($arg:tt)*) => {{
        #[cfg(not(feature = "no_logging"))]
        if let Some(w) = $logger.line_writer() {
            let _ = writeln!(w, $($arg)*);
        }
    }};
}