4 releases
new 0.1.3 | Apr 12, 2025 |
---|---|
0.1.2 | Apr 12, 2025 |
0.1.1 | Apr 11, 2025 |
0.1.0 | Feb 21, 2023 |
#1540 in #logging
150 downloads per month
10KB
185 lines
elara-log
This is an old version of the elara-log
library. It is now developed in a new repository and this old version should be considered deprecated. We keep it here only for compatibility purposes; users are advised to switch to the new version of this crate.
lib.rs
:
Note: This crate is deprecated. Users should switch to the new version of this crate instead.
This crate provides basic logging capabilities for the Project Elara suite of open-source software libraries. It can also be used as a general-purpose lightweight logging library. It has just five logging macros:
debug!(some_debug_message)
error!(some_error_message)
info!(some_info_message)
success!(some_success_message)
warn!(some_success_message)
The macros accept the same format strings as println!
which
allows using string substitutions:
info!("The Answer to {} is {}.",
"the Ultimate Question of Life, the Universe, and Everything",
"42");
To use it, just import the crate and initialize the logger
in your main()
before calling any of the logging macros:
// required in all cases
// (including if you're using
// elara-log in a library)
use elara_log::prelude::*;
fn main() {
// for executables/applications only
// add this before calling any of
// the logging macros
Logger::new().init().unwrap();
}
Dependencies
~9KB