Macros for multi-level formatted logging used by ArceOS.
The log macros, in descending order of level, are: [error!], [warn!],
[info!], [debug!], and [trace!].
If it is used in no_std environment, the users need to implement the
[LogIf] to provide external functions such as console output.
To use in the std environment, please enable the std feature:
[]
= { = "0.1", = ["std"] }
Cargo features:
std: Use in thestdenvironment. If it is enabled, you can use console output without implementing the [LogIf] trait. This is disabled by default.
Examples
use ;
// Initialize the logger.
init;
// Set the maximum log level to `info`.
set_max_level;
// The following logs will be printed.
error!;
warn!;
info!;
// The following logs will not be printed.
debug!;
trace!;