macro_rules! log {
($plat:expr, $level:ident, $target:expr, $message:expr) => { ... };
($plat:expr, $level:ident, $target:expr, $message:expr, $($params:tt)*) => { ... };
}Expand description
Helper macro for using the crate::platform::PlatformRef::log function.
This macro takes at least 4 parameters:
- A reference to an implementation of the
crate::platform::PlatformReftrait. - A log level:
Error,Warn,Info,Debug, orTrace. Seecrate::platform::LogLevel. - A
&strrepresenting the target of the logging. This can be used in order to filter log entries belonging to a specific target. - An object that implements of
AsRef<str>and that contains the log message itself.
In addition to these parameters, the macro accepts an unlimited number of extra (comma-separated) parameters.
Each parameter has one of these four syntaxes:
key = value, wherekeyis an identifier andvaluean expression that implements theDisplaytrait.key = ?value, wherekeyis an identifier andvaluean expression that implements theDebugtrait.key, which is syntax sugar forkey = key.?key, which is syntax sugar forkey = ?key.