1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// Logs the given `format!`-style data to the browser's console, or to stdout
/// as usual on the server.
#[macro_export]
#[cfg(client)]
macro_rules! web_log {
    ($format_str:literal $(, $data:expr)*) => {
        $crate::log::log_js_value(
            &$crate::log::JsValue::from(
                format!($format_str $(, $data)*)
            )
        );
    };
}

/// Logs the given `format!`-style data to the browser's console, or to stdout
/// on the server.
#[macro_export]
#[cfg(engine)]
macro_rules! web_log {
    ($format_str:literal $(, $data:expr)*) => {
        println!($format_str $(, $data)*)
    };
}