#log #cli

pokey_logger

A logging library to log different levels and colours

10 releases

Uses new Rust 2021

0.3.3 Sep 11, 2022
0.3.2 Sep 11, 2022
0.3.1 Mar 12, 2022
0.2.2 Feb 2, 2022
0.1.2 Jan 21, 2022

#123 in Debugging

Download history 64/week @ 2022-05-31 16/week @ 2022-06-07 2/week @ 2022-06-21 8/week @ 2022-07-05 8/week @ 2022-07-12 16/week @ 2022-07-19 18/week @ 2022-07-26 17/week @ 2022-08-02 1/week @ 2022-08-16 14/week @ 2022-08-23 1/week @ 2022-08-30 58/week @ 2022-09-06 21/week @ 2022-09-13

94 downloads per month

GPL-3.0-only

56KB
925 lines

Pokey Logger

gpl 3 badge crates.io badge crates.io downloads

A simple logging library for Rust.

Usage

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

Usage in Rust

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.

Documentation

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

Dependencies

~8–590KB
~12K SLoC