diff --git a/rhubarb/src/rhubarb/sinks.cpp b/rhubarb/src/rhubarb/sinks.cpp index 07dadbe..3b2e1b2 100644 --- a/rhubarb/src/rhubarb/sinks.cpp +++ b/rhubarb/src/rhubarb/sinks.cpp @@ -16,6 +16,7 @@ using boost::optional; NiceStderrSink::NiceStderrSink(Level minLevel) : minLevel(minLevel), + progress(0.0), innerSink(make_shared(make_shared())) {} @@ -26,7 +27,8 @@ void NiceStderrSink::receive(const logging::Entry& entry) { startProgressIndication(); } else if (const ProgressEntry* progressEntry = dynamic_cast(&entry)) { assert(progressBar); - progressBar->reportProgress(progressEntry->getProgress()); + progress = progressEntry->getProgress(); + progressBar->reportProgress(progress); } else if (dynamic_cast(&entry)) { interruptProgressIndication(); std::cerr << "Done." << std::endl; @@ -54,7 +56,7 @@ void NiceStderrSink::interruptProgressIndication() { void NiceStderrSink::resumeProgressIndication() { std::cerr << "Progress (cont'd): "; - progressBar = boost::in_place(); + progressBar = boost::in_place(progress); progressBar->setClearOnDestruction(false); } diff --git a/rhubarb/src/rhubarb/sinks.h b/rhubarb/src/rhubarb/sinks.h index 5e053db..9bf47e3 100644 --- a/rhubarb/src/rhubarb/sinks.h +++ b/rhubarb/src/rhubarb/sinks.h @@ -17,6 +17,7 @@ private: void resumeProgressIndication(); logging::Level minLevel; + double progress; boost::optional progressBar; std::shared_ptr innerSink; };