5 releases

Uses new Rust 2024

new 0.3.0-preview.3 Mar 11, 2026
0.3.0-preview.2 Mar 6, 2026
0.3.0-preview.1 Mar 4, 2026
0.2.2-preview.1 Feb 6, 2026
0.2.1-preview.1 Feb 6, 2026

#277 in Debugging

Download history 29/week @ 2026-02-03 23/week @ 2026-02-10 74/week @ 2026-02-17 132/week @ 2026-02-24 197/week @ 2026-03-03

437 downloads per month
Used in 25 crates (15 directly)

GPL-3.0-or-later OR Apache-2…

10KB
162 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]
axlog = { version = "0.1", features = ["std"] }

Cargo features:

  • std: Use in the std environment. If it is enabled, you can use console output without implementing the LogIf trait. This is disabled by default.

Examples

use axlog::{debug, error, info, trace, warn};

// Initialize the logger.
axlog::init();
// Set the maximum log level to `info`.
axlog::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–1MB
~19K SLoC