diff --git a/CHANGELOG.md b/CHANGELOG.md index 49782457..f1f526c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ Upon updating Pueue and restarting the daemon, the previous state will be wiped, Pueue now allows editing all properties a task in one editor session. There're two modes to do so: `toml` and `files`. - Revisited, fixed and cleaned up CLI help texts. - Print most of Pueue's info/log messages to `stderr`. Only keep useful stuff like json and task log output on `stdout`. +- **Breaking** Uses `color-eyre` for a generic error type instead of `anyhow`, potentially breaking library users ### Add diff --git a/pueue/src/lib.rs b/pueue/src/lib.rs index 71186534..87092597 100644 --- a/pueue/src/lib.rs +++ b/pueue/src/lib.rs @@ -22,7 +22,6 @@ pub mod tracing { fmt::time::OffsetTime, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer, }; - // idea: use local time zone? pub fn install_tracing(verbosity: u8) -> Result<()> { let mut pretty = false; let level = match verbosity { @@ -36,13 +35,15 @@ pub mod tracing { } }; - type GenericLayer = Box + Send + Sync>; - let offset = time::UtcOffset::current_local_offset().expect("should get local offset!"); + // todo: only log error and continue instead of panicing? + let offset = + time::UtcOffset::current_local_offset().wrap_err("should get local offset!")?; let timer = OffsetTime::new( offset, time::macros::format_description!("[hour]:[minute]:[second]"), ); + type GenericLayer = Box + Send + Sync>; let fmt_layer: GenericLayer<_> = match pretty { false => Box::new(tracing_subscriber::fmt::layer().with_timer(timer)), true => Box::new( diff --git a/pueue/tests/daemon/integration/restore.rs b/pueue/tests/daemon/integration/restore.rs index 876f5156..430f4ac2 100644 --- a/pueue/tests/daemon/integration/restore.rs +++ b/pueue/tests/daemon/integration/restore.rs @@ -1,6 +1,5 @@ use crate::prelude::*; - use pueue_lib::network::message::TaskSelection; use pueue_lib::state::GroupStatus; diff --git a/pueue/tests/daemon/integration/shutdown.rs b/pueue/tests/daemon/integration/shutdown.rs index 5df1caa3..0a8df6fb 100644 --- a/pueue/tests/daemon/integration/shutdown.rs +++ b/pueue/tests/daemon/integration/shutdown.rs @@ -1,6 +1,5 @@ use crate::prelude::*; - use crate::helper::*; /// Spin up the daemon and send a SIGTERM shortly afterwards. diff --git a/pueue/tests/daemon/integration/worker_environment_variables.rs b/pueue/tests/daemon/integration/worker_environment_variables.rs index fcd0d834..6301b0cf 100644 --- a/pueue/tests/daemon/integration/worker_environment_variables.rs +++ b/pueue/tests/daemon/integration/worker_environment_variables.rs @@ -1,6 +1,5 @@ use crate::prelude::*; - use pueue_lib::{network::message::TaskSelection, state::PUEUE_DEFAULT_GROUP, task::Task}; use crate::helper::*; diff --git a/pueue_lib/tests/settings_backward_compatibility.rs b/pueue_lib/tests/settings_backward_compatibility.rs index 27ae2137..89110711 100644 --- a/pueue_lib/tests/settings_backward_compatibility.rs +++ b/pueue_lib/tests/settings_backward_compatibility.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use color_eyre::{Result, eyre::WrapErr}; +use color_eyre::{eyre::WrapErr, Result}; use pueue_lib::settings::Settings;