9 releases
Uses new Rust 2024
| new 0.5.12 | May 18, 2026 |
|---|---|
| 0.5.11 | Apr 16, 2026 |
#394 in Debugging
150 downloads per month
Used in 10 crates
(5 directly)
48KB
954 lines
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:
[dependencies]
ax-log = { version = "0.1", features = ["std"] }
Cargo features:
std: Use in thestdenvironment. If it is enabled, you can use console output without implementing theLogIftrait. This is disabled by default.
Examples
use ax_log::{debug, error, info, trace, warn};
// Initialize the logger.
ax_log::init();
// Set the maximum log level to `info`.
ax_log::set_max_level("info");
// The following logs will be printed.
error!("error");
warn!("warn");
info!("info");
// The following logs will not be printed.
debug!("debug");
trace!("trace");
Dependencies
~0.2–0.8MB
~16K SLoC