From a9894b67f98c7d4478d4e202602c66351e0e15a7 Mon Sep 17 00:00:00 2001 From: Paul Otto Date: Thu, 5 Nov 2026 17:32:28 +0100 Subject: [PATCH 1/3] fix(cli): CLOOFY_LOG with a trailing comma `Targets` reads an empty directive as errors only for everything, so `CLOOFY_LOG=info,` logged errors only. Empty directives are left out now. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + crates/cloofy/src/main.rs | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff851de..8ba5c69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ All notable changes to cloofy. The format follows [Keep a Changelog](https://kee - **Spotify's mixes in your library.** The playlists Spotify makes for you, like Club Mix, Hip Hop Mix, the Daily Mixes and Discover Weekly, show up in your library once you've saved them in Spotify, in the order you picked there. So do the other Spotify playlists you follow. Spotify's Web API leaves them out, so cloofy now lists your library the way Spotify's own apps do. - **Spotify's mixes in search.** Searching for "synthwave" or "club mix" finds your Synthwave Mix or Club Mix first, as in Spotify, and shows the song count wherever Spotify gives it. - **`cloofy doctor`** checks both. +- **`CLOOFY_LOG` with a trailing comma,** as in `info,`, logs at that level instead of errors only. ### Security diff --git a/crates/cloofy/src/main.rs b/crates/cloofy/src/main.rs index f25325d..ab66f91 100644 --- a/crates/cloofy/src/main.rs +++ b/crates/cloofy/src/main.rs @@ -206,12 +206,7 @@ fn services(paths: &Paths, named: Option<&str>) -> Result> { /// Logs go to stderr for CLI commands; the TUI owns the screen, so it logs to a file. fn init_logging(paths: &Paths, tui: bool) -> Result<()> { - // Same syntax as before, such as `info,librespot=debug`, without EnvFilter's regexes. - let filter = std::env::var("CLOOFY_LOG") - .ok() - .and_then(|filter| filter.parse::().ok()) - .unwrap_or_else(|| Targets::new().with_default(tracing::Level::ERROR)); - let logs = tracing_subscriber::registry().with(filter); + let logs = tracing_subscriber::registry().with(log_filter(std::env::var("CLOOFY_LOG").ok().as_deref())); if tui { std::fs::create_dir_all(&paths.cache)?; std::fs::File::create(paths.log_file())?; @@ -300,12 +295,34 @@ fn link_service(input: &str) -> Option { } } +/// What `CLOOFY_LOG` asks for, with the same syntax as before, such as `info,librespot=debug`, +/// without EnvFilter's regexes; errors only when it's unset or unreadable. Empty directives, as in +/// a trailing comma, are left out: `Targets` reads one as errors only for everything, so +/// `info,` logged errors only. +fn log_filter(spec: Option<&str>) -> Targets { + let errors = || Targets::new().with_default(tracing::Level::ERROR); + let directives: Vec<&str> = spec.unwrap_or_default().split(',').map(str::trim).filter(|d| !d.is_empty()).collect(); + if directives.is_empty() { errors() } else { directives.join(",").parse().unwrap_or_else(|_| errors()) } +} + #[cfg(test)] mod tests { use clap::CommandFactory; use super::*; + #[test] + fn log_filters_leave_out_empty_directives() { + use tracing::Level; + let on = |spec, target, level| log_filter(spec).would_enable(target, &level); + assert!(on(None, "cloofy", Level::ERROR) && !on(None, "cloofy", Level::WARN)); + assert!(on(Some(""), "cloofy", Level::ERROR), "empty is unset"); + assert!(on(Some("info,"), "cloofy", Level::INFO), "a trailing comma keeps info"); + assert!(on(Some(" info , librespot=debug"), "librespot", Level::DEBUG)); + assert!(!on(Some("info,librespot=debug"), "cloofy", Level::DEBUG)); + assert!(on(Some("=not a level"), "cloofy", Level::ERROR), "unreadable is unset"); + } + #[test] fn links_go_to_their_service() { assert_eq!(link_service("https://open.spotify.com/album/2noRn2Aes5aoNVsU6iWThc"), Some(Service::Spotify)); From 91e961450cbfddbf02405df1077fdd225e39d267 Mon Sep 17 00:00:00 2001 From: Paul Otto Date: Thu, 5 Nov 2026 17:34:18 +0100 Subject: [PATCH 2/3] chore: version 0.5.1 Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 14 +++++++------- Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be264aa..8faa208 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -436,7 +436,7 @@ checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486" [[package]] name = "cloofy" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", "clap", @@ -461,7 +461,7 @@ dependencies = [ [[package]] name = "cloofy-core" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", "cloofy-os", @@ -480,7 +480,7 @@ dependencies = [ [[package]] name = "cloofy-os" -version = "0.5.0" +version = "0.5.1" dependencies = [ "block2", "dispatch2", @@ -501,7 +501,7 @@ dependencies = [ [[package]] name = "cloofy-player" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", "cloofy-core", @@ -515,7 +515,7 @@ dependencies = [ [[package]] name = "cloofy-spotify" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", "base64 0.23.1", @@ -538,7 +538,7 @@ dependencies = [ [[package]] name = "cloofy-tui" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", "base64 0.23.1", @@ -571,7 +571,7 @@ dependencies = [ [[package]] name = "cloofy-ytmusic" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", "cloofy-core", diff --git a/Cargo.toml b/Cargo.toml index 3271d30..d10d4d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ members = ["crates/*"] exclude = ["vendor"] [workspace.package] -version = "0.5.0" +version = "0.5.1" edition = "2024" rust-version = "1.90" license = "MIT" From 752a5e2fc26ca90a41ba3fa608b17ddee9fb958b Mon Sep 17 00:00:00 2001 From: Paul Otto Date: Thu, 5 Nov 2026 17:44:17 +0100 Subject: [PATCH 3/3] chore(release): 0.5.1 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ba5c69..84544c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to cloofy. The format follows [Keep a Changelog](https://kee ## [Unreleased] +## [0.5.1] - 2026-11-05 + +cloofy takes on your terminal's colors or your own, and song notifications reach every terminal on Linux. + ### Added - **Your terminal's colors.** Settings has Colors now. **Terminal** takes your terminal's background and text, with the shades in between mixed from them, so cloofy looks at home in a purple Ptyxis on Ubuntu or any other theme. **Auto** stays as before: Omarchy's theme there, cloofy's own dark colors elsewhere, which **cloofy** keeps everywhere. @@ -142,7 +146,8 @@ The first release. - **Session restore.** The page, the selection and the last track come back after a restart. - **Installer.** It sets everything up step by step. -[Unreleased]: https://github.com/parda21/cloofy/compare/v0.5.0...HEAD +[Unreleased]: https://github.com/parda21/cloofy/compare/v0.5.1...HEAD +[0.5.1]: https://github.com/parda21/cloofy/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/parda21/cloofy/compare/v0.4.0...v0.5.0 [0.4.0]: https://github.com/parda21/cloofy/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/parda21/cloofy/compare/v0.2.0...v0.3.0