Skip to content

fix: use indicatif-log-bridge to avoid breaking progress bar on log#1747

Open
LucaCiucci wants to merge 4 commits intorustic-rs:mainfrom
LucaCiucci:main
Open

fix: use indicatif-log-bridge to avoid breaking progress bar on log#1747
LucaCiucci wants to merge 4 commits intorustic-rs:mainfrom
LucaCiucci:main

Conversation

@LucaCiucci
Copy link
Copy Markdown

@LucaCiucci LucaCiucci commented Apr 29, 2026

Tentative fix for #1746 using indicatif-log-bridge.

Marking as "draft" PR since it adds some flickering to the progress bar. I have to investigate this.

Fixes #1746.

When showing a progress bar, a log message previously caused the bar
to be printed again without clearing. `indicatif-log-bridge` solves
that by just pausing the progress bar before printing.

Unfortunately this intriduces some flickering to the progress bar for
unknown reasons.
`indicatif-log-bridge` combined with log4rs appenders cause some
flickering of the progress bars. The reason is that
`<log4r::Logger as log::Log>::enabled` does a coarse filtering and
single appenders may decide not to print any message. This is the case
with our `FileAppender`, which forces many trace and debug messages to
be hidden but still flagged as enabled. This causes many unnecessary
pauses inside `indicatif-log-bridge`, which uses `log::Log::enabled`
as a discriminant.

This new approach avoids the issue by wrapping the specific `FileLogger`
appender, so that we suspend the progress bar only when the real print
happens.
@LucaCiucci
Copy link
Copy Markdown
Author

d97f4f2 fixes the flickering issue.
Marking as "Ready for review".

@LucaCiucci LucaCiucci marked this pull request as ready for review April 30, 2026 19:25
@LucaCiucci
Copy link
Copy Markdown
Author

Checks should be fixed now.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log output breaks progress bar

1 participant