Skip to content

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

Merged
aawsome merged 4 commits into
rustic-rs:mainfrom
LucaCiucci:main
May 2, 2026
Merged

fix: use indicatif-log-bridge to avoid breaking progress bar on log#1747
aawsome merged 4 commits into
rustic-rs:mainfrom
LucaCiucci:main

Conversation

@LucaCiucci
Copy link
Copy Markdown
Contributor

@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
Contributor 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
Contributor Author

Checks should be fixed now.

Copy link
Copy Markdown
Member

@aawsome aawsome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aawsome aawsome added this pull request to the merge queue May 2, 2026
@aawsome
Copy link
Copy Markdown
Member

aawsome commented May 2, 2026

Thanks @LucaCiucci for this PR!
I actually reviewed an old version yesterday and was trying to understand why wrapping the TextAppender would work for this ;-) - then I saw the new commit :-)

Merged via the queue into rustic-rs:main with commit bf3c820 May 2, 2026
30 checks passed
@LucaCiucci
Copy link
Copy Markdown
Contributor Author

Sorry for the confusion @aawsome , I initially wrapped the wrong appender.
Thanks for merging!

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

2 participants