]> git.ipfire.org Git - thirdparty/zstd.git/commit
Refactor progress bar & summary line logic
authorNick Terrell <terrelln@fb.com>
Fri, 7 Jan 2022 23:07:28 +0000 (15:07 -0800)
committerNick Terrell <nickrterrell@gmail.com>
Wed, 14 Dec 2022 23:44:09 +0000 (15:44 -0800)
commitfbff7827faba30df7c49992cb39dc00ce36c6a06
treed9bdb71685ef161b29795d544da06f1402b00688
parente58a39f84e988e4229067372b4f30601dcfc484b
Refactor progress bar & summary line logic

* Centralize the logic about whether to print the progress bar or not in
  the `*_PROGRESS()` macros.
* Centralize the logc about whether to print the summary line or not in
  `FIO_shouldDisplayFileSummary()` and
  `FIO_shouldDisplayMultipleFileSummary()`.
* Make `--progress` work for non-zstd (de)compressors.
* Clean up several edge cases in compression and decompression progress
  printing along the way. E.g. wrong log level, or missing summary line.

One thing I don't like about stdout mode, which sets the display level
to 1, is that warnings aren't displayed. After this PR, we could change
stdout mode from lowering the display level, to defaulting to implied
`--no-progress`. But, I think that deserves a separate PR.
programs/fileio.c
programs/fileio_common.h
tests/cli-tests/progress/no-progress.sh [new file with mode: 0755]
tests/cli-tests/progress/no-progress.sh.stderr.glob [new file with mode: 0644]
tests/cli-tests/progress/progress.sh [new file with mode: 0755]
tests/cli-tests/progress/progress.sh.stderr.glob [new file with mode: 0644]