diff --git a/README.md b/README.md index 0990e05..f13787b 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,20 @@ This project is documented in the form of code comments and Rust doc comments. I `cargo doc --open --no-deps` +## Logging + +lykin emits logs at three levels: `debug`, `info` and `warn`. The log level can be set using the `RUST_LOG` environment variable. + +For example, emit only `info` logs: + +`RUST_LOG=lykin=info ./target/release/lykin` + +It is also possible to emit logs solely from a single module of lykin. + +For example, emit only `warn` logs from the `db` module of lykin: + +`RUST_LOG=lykin::db=warn cargo run` + ## Thanks I am grateful to the Butts who voted to fund this work, all contributors to the SSBC and Erick Lavoie in particular - both for partially funding this work and for developing and overseeing the community grant process. diff --git a/src/main.rs b/src/main.rs index ec4b1db..5e0f8e8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -70,6 +70,21 @@ //! //! `cargo doc --open --no-deps` //! +//! ## Logging +//! +//! lykin emits logs at three levels: `debug`, `info` and `warn`. The log level +//! can be set using the `RUST_LOG` environment variable. +//! +//! For example, emit only `info` logs: +//! +//! `RUST_LOG=lykin=info ./target/release/lykin` +//! +//! It is also possible to emit logs solely from a single module of lykin. +//! +//! For example, emit only `warn` logs from the `db` module of lykin: +//! +//! `RUST_LOG=lykin::db=warn cargo run` +//! //! ## Thanks //! //! I am grateful to the Butts who voted to fund this work, all contributors to