mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-04-19 19:34:24 +02:00
feat(logging): IRONBAR_LOG
and IRONBAR_FILE_LOG
env vars
This commit is contained in:
parent
70e1b526a9
commit
ec1d59677b
3 changed files with 15 additions and 5 deletions
|
@ -14,3 +14,4 @@ I welcome contributions of any kind with open arms. That said, please do stick t
|
||||||
|
|
||||||
- For issues:
|
- For issues:
|
||||||
- Please provide as much information as you can - share your config, any logs, steps to reproduce...
|
- 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`.
|
||||||
|
|
14
README.md
14
README.md
|
@ -1,6 +1,6 @@
|
||||||
# Ironbar
|
# 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.
|
It uses GTK3 and gtk-layer-shell.
|
||||||
|
|
||||||
The bar can be styled to your liking using CSS and hot-loads style changes.
|
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
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Run using `ironbar`.
|
## Installation
|
||||||
|
|
||||||
### Cargo
|
### Cargo
|
||||||
|
|
||||||
|
@ -42,6 +41,15 @@ install target/release/ironbar ~/.local/bin/ironbar
|
||||||
|
|
||||||
[repo](https://github.com/jakestanger/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
|
## Configuration
|
||||||
|
|
||||||
Ironbar gives a lot of flexibility when configuring, including multiple file formats
|
Ironbar gives a lot of flexibility when configuring, including multiple file formats
|
||||||
|
|
|
@ -32,9 +32,10 @@ impl<'a> MakeWriter<'a> for MakeFileWriter {
|
||||||
/// for the lifetime of the application for logging to file to work.
|
/// for the lifetime of the application for logging to file to work.
|
||||||
pub fn install_tracing() -> Result<WorkerGuard> {
|
pub fn install_tracing() -> Result<WorkerGuard> {
|
||||||
let fmt_layer = fmt::layer().with_target(true);
|
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 =
|
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");
|
let log_path = data_dir().unwrap_or(env::current_dir()?).join("ironbar");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue