From d2cdd8e5149f89c63b0256cf3eb4eda31992e6a9 Mon Sep 17 00:00:00 2001 From: "D. Scott Boggs" Date: Thu, 29 Dec 2022 12:19:23 -0500 Subject: [PATCH] Add debugging note to the README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 394ad82..6933f0f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,23 @@ Alternatively, run the following command: $ cargo add mastodon-async ~~~ +## A Note on Debugging +This library offers structured logging. To get better information about bugs or +how something is working, I recommend adding the femme crate as a dependency, +then adding this line to the beginning of your main() function: + +```rust +femme::with_level(log::LevelFilter::Trace); +``` + +When compiling for the debug target, this offers a mostly-human-readable output +with a lot of details about what's happening. When targeting release, JSON- +structured metadata is offered, which can be filtered and manipulated with +scripts or at the shell with jq. + +There are other crates which make use of the log crate's new (unstable) kv +features, this is just the one that works for me for now. + ## Example In your `Cargo.toml`, make sure you enable the `toml` feature: