Skip to content

pitchfork floods logs when run in CI #1126

Closed

Description

@neilconway

When run in CI, pitchfork emits many thousands of lines like:

25l⠋ pitchfork: [all-events/fake-imds] waiting for HTTP http://169.254.169.254/latest/meta-data/instance-id...
⠋ pitchfork: [all-events/fake-s3] waiting for HTTP http://localhost:21101/health...
⠋ pitchfork: [all-events/pg-api] waiting for TCP port 21300...
⠋ pitchfork: [all-events/pg-nessie] waiting for TCP port 21301...
25l⠋ pitchfork: [all-events/fake-imds] waiting for HTTP http://169.254.169.254/latest/meta-data/instance-id...
⠋ pitchfork: [all-events/fake-s3] waiting for HTTP http://localhost:21101/health...
⠋ pitchfork: [all-events/pg-api] waiting for TCP port 21300...
⠋ pitchfork: [all-events/pg-nessie] waiting for TCP port 21301...

This seems to be caused by the underlying clx library redrawing a spinner every 200ms by default, even when stderr is not a terminal. This can be fixed by configuring clx to use text mode:

diff --git a/src/main.rs b/src/main.rs
index 97c783f..2d541b2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -65,11 +65,25 @@ async fn main() -> Result<()> {
     // Re-apply log levels now that settings (env + config files) are loaded.
     // logger::init() only sees env vars; this picks up pitchfork.toml values.
     logger::apply_settings();
+    init_progress_output();
     #[cfg(unix)]
     handle_epipe();
     cli::run().await
 }

+/// Switches progress output to plain lines when stderr is not a terminal.
+///
+/// clx defaults to its animated UI, which redraws in place several times a
+/// second. Without a terminal to interpret the cursor movement, every redraw
+/// lands in the output as new lines. Text mode instead prints one line per
+/// status change.
+fn init_progress_output() {
+    use std::io::IsTerminal;
+    if !std::io::stderr().is_terminal() {
+        clx::progress::set_output(clx::progress::ProgressOutput::Text);
+    }
+}
+
 #[cfg(unix)]
 fn handle_epipe() {
     match signal::unix::signal(SignalKind::pipe()) {

(Patch produced with Claude Code, Fable 5.2).

Happy to send a PR but that seems to currently be disabled.

Activity

  1. github-actions commented on Nov 16, 2026

    @github-actions
    Contributor

    Fixed in v2.35.0 by #1127.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions