Skip to main content

warn

Macro warn 

Source
macro_rules! warn {
    (logger: $logger:expr, target: $target:expr, $($arg:tt)+) => { ... };
    (logger: $logger:expr, $($arg:tt)+) => { ... };
    (target: $target:expr, $($arg:tt)+) => { ... };
    ($($arg:tt)+) => { ... };
}
Expand description

Logging (docs/logging.md). day::info!("…") and friends are the log crate’s macros, re-exported so an app needs no log dependency of its own for the common case. Because they are log’s, anything that speaks log (env_logger, tracing-log, a hand-written log::Log) works without adapters.

Day installs a default logger at launch, so these come out with no setup on every platform: stderr natively, the browser console on web-dom. An app that wants something else calls log::set_logger (or env_logger::init()) before day::launch and keeps it. Logs a message at the warn level.

§Examples

use log::warn;

let warn_description = "Invalid Input";

warn!("Warning! {warn_description}!");
warn!(target: "input_events", "App received warning: {warn_description}");
warn!(logger: my_logger, "App received warning: {warn_description}");