diff options
| author | 2026-11-03 12:22:03 +0100 | |
|---|---|---|
| committer | 2026-11-03 12:22:03 +0100 | |
| commit | ae8cfb4aa919000b283a0fe7db96b1a321a010d3 (patch) | |
| tree | b6b0266686236afdc7ff0cd10e8fc23fefa827e1 /src/log.c | |
| parent | 8f209f9635e20b84b6eb41ce2e4ed5c0e59b38f9 (diff) | |
| download | idevicerestore-ae8cfb4aa919000b283a0fe7db96b1a321a010d3.tar.gz idevicerestore-ae8cfb4aa919000b283a0fe7db96b1a321a010d3.tar.bz2 | |
Replace the single-line progress bar with a terminal renderer that
shows one row per active progress tag. The overall restore step
(Uploading/Verifying filesystem, Flashing firmware) is a reserved
"global" bar that is always drawn first. Per-component bars (e.g.
SEP, RestoreRamDisk) appear below it and disappear when finalized.
- Redraw in place with ANSI cursor movement; clamp line width to the
terminal width (ioctl on Unix, console API on Windows, with virtual
terminal mode enabled)
- Erase and redraw the bars around logger() output so log lines no
longer corrupt the display
- Remove the global bar once a different restore step starts
- When stdout is not a TTY, skip escape codes and print only the
changed bar, once per 1% step
- Fix progress throttling: lastprog was an int and was compared after
being overwritten, so granularity was never applied
- RESTORE_STEP_UPLOAD_IMG no longer drives the global bar; it already
has per-component bars
Diffstat (limited to 'src/log.c')
| -rw-r--r-- | src/log.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -38,6 +38,7 @@ #include <plist/plist.h> #include "log.h" +#include "common.h" static int stderr_enabled = 1; @@ -105,6 +106,7 @@ void logger(enum loglevel level, const char *fmt, ...) return; mutex_lock(&log_mutex); + progress_display_suspend(); size_t fslen = 24 + strlen(fmt); fs = malloc(fslen); @@ -149,6 +151,7 @@ void logger(enum loglevel level, const char *fmt, ...) free(fs); + progress_display_resume(); mutex_unlock(&log_mutex); } |
