commit 055dceeececb9328e688f47a0fbdb4a1687e42a2
parent 86e0fe665d7fda4f09755ff682cea8dc03b0000a
Author: Johann150 <johann.galle@protonmail.com>
Date: Fri, 5 Feb 2021 08:43:07 +0100
also check logging environment variable
Diffstat:
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
@@ -80,9 +80,14 @@ LICENSE:text/plain;charset=UTF-8
gone.gmi:52 This file is no longer here, sorry.
```
+### Logging Verbosity
+
+Agate uses the `env_logger` crate and allows you to set the logging verbosity by setting the default `RUST_LOG` environment variable. For more information, please see the [documentation of `env_logger`].
+
[Gemini]: https://gemini.circumlunar.space/
[Rust]: https://www.rust-lang.org/
[home]: gemini://gem.limpet.net/agate/
[rustup]: https://www.rust-lang.org/tools/install
[source]: https://github.com/mbrubeck/agate
[crates.io]: https://crates.io/crates/agate
+[documentation of `env_logger`]: https://docs.rs/env_logger/0.8
diff --git a/src/main.rs b/src/main.rs
@@ -24,7 +24,10 @@ use {
fn main() -> Result {
if !ARGS.silent {
- env_logger::Builder::new().parse_filters("info").init();
+ env_logger::Builder::new()
+ .filter_level(log::LevelFilter::Info)
+ .parse_default_env()
+ .init();
}
Runtime::new()?.block_on(async {
let mimetypes = Arc::new(Mutex::new(FileOptions::new(PresetMeta::Parameters(