mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-01 02:31:04 +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
|
@ -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<WorkerGuard> {
|
||||
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");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue