Skip to content

v2.16.0: Log filtering and a settings-preserving config write

Choose a tag to compare

@jdx jdx released this 09 Jul 15:35
· 173 commits to main since this release
Immutable release. Only release title and notes can be modified.
e99c048

A focused release: pitchfork logs gains first-class filtering, a nasty config-write bug that silently wiped [settings.*] entries is fixed, and the web log viewer no longer eats the first token of daemon output.

Added

  • Log filtering with --grep, --regex, and --case-sensitive (#532) — @gaojunran. pitchfork logs can now filter messages at the SQLite layer, so history and --tail both respect the filter without extra pipes:

    pitchfork logs api --grep error --grep warn        # OR across substrings
    pitchfork logs api --regex '5\d{2}' --tail          # regex, live tail
    pitchfork logs api --grep Login --case-sensitive

    Multiple --grep values are combined with OR. Regex patterns are validated up front so you get a clear CLI error instead of a mid-query SQLite failure. Behind the scenes, a regexp scalar function is registered per connection with an LRU cache so repeated patterns don't recompile per row, and the supervisor now batches log inserts (100 lines / 100 ms) via a new append_batch path — with a synchronous flush right before ready-pattern signalling and process exit, so startup-log capture and trailing lines both stay accurate.

Fixed

  • Config writes preserve existing [settings.*] entries (#575, fixes #574) — @gaojunran. write_unlocked() was constructing the on-disk config without copying self.settings, so any read-modify-write cycle silently dropped existing settings. That broke settings set (the new value was discarded) and proxy add / register_namespace / remove_slug (which wiped previously configured settings as a side effect). Settings are now round-tripped through writes, with an is_empty() guard so empty configs don't emit a bare [settings] header.

  • Web log viewer no longer drops the first message token or leaks timestamps (#581) — @gaojunran. The web UI's LOG_PREFIX_RE was modeled on pitchfork's internal <ts> <level> <msg> format and, when applied to arbitrary daemon stdout, silently ate the daemon's first content token (often its own log level) and failed to strip prefixes from indented or blank continuation lines — which caused pitchfork's prepended timestamp to leak into the rendered content. The parser now strips only the fixed <ts> prefix added by the web log API and keeps the message verbatim.

  • tera upgraded to v2 (#571). The template renderer now registers a compatibility default filter matching v1 semantics (supports value= and boolean=) so existing pitchfork.toml templates keep working.

  • ARM64 Linux release binaries run on older glibc hosts again (#580) — @brandon-julio-t. The aarch64-unknown-linux-gnu release build is now pinned to cross-rs 0.2.5 instead of the mutable :main tag, so the resulting binary targets glibc 2.18 and runs on hosts like Amazon Linux 2023 (glibc 2.34). v2.15.0 had silently picked up a GLIBC_2.39 requirement from the newer image.

Changed

  • Faster supervisor startup and liveness checks (#576, fixes #439) — @gaojunran. Procs::new() no longer calls System::new_all() / refresh_processes(), which used to scan every process on the system (~500 ms) on first access — including something as trivial as pitchfork cd checking whether the supervisor is alive. is_running() now uses kill(pid, 0) on Unix for an O(1) liveness check independent of the process cache, and seven caller-side refresh calls that existed only to feed the old check have been removed.

  • Consistent, correct IEC byte formatting (#582) — @lthiery. Four hand-rolled formatters in procs.rs and tui/ui.rs divided by 1024 but labeled results as KB/MB/GB. They now use humanbyte 0.4 with matching IEC units (KiB/MiB/GiB in CLI output, compact K/M/G in the TUI), values above GiB roll over to TiB/PiB instead of rendering as e.g. 1100.0GB, and per-magnitude precision is preserved. The published JSON schema for memory_limit now advertises ["string", "integer"], matching the deserializer, which already accepted raw byte counts like memory_limit = 52428800.

  • Dependency bumps: ratatui 0.30.2 (#567), xx 2.6.1 (#570).

New Contributors

Full Changelog: v2.15.0...v2.16.0

💚 Sponsor pitchfork

pitchfork is maintained by @jdx, an open source developer for entire.io, the title sponsor of the jdx.dev open source tools including mise, aube, hk, and more. Development is sustained by sponsorships.

If pitchfork has a place in your dev workflow, please consider sponsoring at jdx.dev. Individual and company sponsorships are what keep the project healthy and moving forward.