perseus/utils/
log.rs

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