macro_rules! warn {
(($($arg:tt)+), $location:expr $(,)?) => { ... };
($($arg:tt)+) => { ... };
}Expand description
Logs an warning to Duat.
Use this, as opposed to error!, info! or debug!,
if you want to tell the user that something was partially
successful, or that a failure happened, but
it’s near inconsequential.
This error follows the same construction as the txt!
macro, and will create a Record inside of the Logs,
which can be accessed by anyone, at any time.
The Record added to the Logs is related to
log::Record, from the log crate. But it differs in the
sense that it is always 'static, and instead of having an
std::fmt::Arguments inside, it contains a Text, making
it a better fit for Duat.
The connection to log::Record also means that external
libraries can log information using the log crate, and it
will also show up in Duat’s Logss, but reformatted to be a
Text instead.
§Custom location
You can make use of a custom location by calling this macro
and surounding the arguments in a () pair.
use duat::prelude::{context::Location, *};
context::warn!(
("This is my {}", "warning"),
Location::new("some_file", 32, 10),
);