Skip to content

Commit

Permalink
Progressbars go to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
RagnarGrootKoerkamp committed Feb 12, 2021
1 parent 571b719 commit 350dc75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ void progress_bar::iter() {
auto step = (it * bar_len) / total;
while (step > bar_step) {
if (bar_step > 0)
std::cout << "\b\b\b\b";
std::cerr << "\b\b\b\b";
++bar_step;
std::cout << "#" << std::setw(3) << (int)(100.0 * it / total) << "%" << std::flush;
std::cerr << "#" << std::setw(3) << (int)(100.0 * it / total) << "%" << std::flush;
}
if (it == total) {
std::cout << "\033[2K\r" << std::flush;
std::cerr << "\033[2K\r" << std::flush;
}
}
}
Expand Down

0 comments on commit 350dc75

Please sign in to comment.