Crates.io | pokey_logger |
lib.rs | pokey_logger |
version | 0.3.3 |
source | src |
created_at | 2022-01-20 21:35:35.016862 |
updated_at | 2022-09-11 10:11:59.095972 |
description | A logging library to log different levels and colours |
homepage | https://github.com/PokeyOne/pokey-logger |
repository | https://github.com/PokeyOne/pokey-logger |
max_upload_size | |
id | 517874 |
size | 106,153 |
A simple logging library for Rust.
First, the library must be added to the project's Cargo.toml
file.
pokey_logger = "0.3.3"
or to get the latest and greatest
pokey_logger = { git = "https://github.com/PokeyOne/pokey-logger" }
For more advanced methods see the Cargo documentation on specifiying dependencies
This section of the README will guide you through the basic steps of getting started with the logger.
In your main rust file, you will want something like this:
#[macro_use]
extern crate pokey_logger;
This will allow you to use the macros from this crate. In your code, you can now access all the macros.
fn main() {
debug!("Hello");
info!("Hàlo, fàilte!");
warn!("This program will end soon...");
error!("No more code");
}
And this will output to the terminal, and all is well. You can then take a look at the crate documentation which goes more in depth on configuration, file-based logging, and more.
To view the documentation locally, run the following command either in this repo or in a project that uses the library.
cargo doc --open
Or go to the crate documentation