diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7fa946b..b77f412 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,3 +14,4 @@ I welcome contributions of any kind with open arms. That said, please do stick t - For issues: - Please provide as much information as you can - share your config, any logs, steps to reproduce... + - If reporting an error, please ensure you use `IRONBAR_LOG` or `IRONBAR_FILE_LOG` set to `debug`. diff --git a/README.md b/README.md index fcf72bd..e85068a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Ironbar -Ironbar is a customisable and feature-rich bar targeting wlroots compositors, written in Rust. +Ironbar is a customisable and feature-rich bar for wlroots compositors, written in Rust. It uses GTK3 and gtk-layer-shell. The bar can be styled to your liking using CSS and hot-loads style changes. @@ -8,9 +8,8 @@ For information and examples on styling please see the [wiki](https://github.com ![Screenshot of fully configured bar with MPD widget open](https://user-images.githubusercontent.com/5057870/184539623-92d56a44-a659-49a9-91f9-5cdc453e5dfb.png) -## Installation -Run using `ironbar`. +## Installation ### Cargo @@ -42,6 +41,15 @@ install target/release/ironbar ~/.local/bin/ironbar [repo](https://github.com/jakestanger/ironbar) +## Running + +All of the above installation methods provide a binary called `ironbar`. + +You can set the `IRONBAR_LOG` or `IRONBAR_FILE_LOG` environment variables to +`error`, `warn`, `info`, `debug` or `trace` to configure the log output level. +These default to `IRONBAR_LOG=info` and `IRONBAR_FILE_LOG=error`. +File output can be found at `~/.local/share/ironbar/error.log`. + ## Configuration Ironbar gives a lot of flexibility when configuring, including multiple file formats diff --git a/src/logging.rs b/src/logging.rs index bdbf5ee..87f18da 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -32,9 +32,10 @@ impl<'a> MakeWriter<'a> for MakeFileWriter { /// for the lifetime of the application for logging to file to work. pub fn install_tracing() -> Result { let fmt_layer = fmt::layer().with_target(true); - let filter_layer = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?; + let filter_layer = EnvFilter::try_from_env("IRONBAR_LOG").or_else(|_| EnvFilter::try_new("info"))?; + let file_filter_layer = - EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("warn"))?; + EnvFilter::try_from_env("IRONBAR_FILE_LOG").or_else(|_| EnvFilter::try_new("warn"))?; let log_path = data_dir().unwrap_or(env::current_dir()?).join("ironbar");