Skip to content

Commit 25362ea

Browse files
committed
add progress info to logs
1 parent fe00784 commit 25362ea

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ To install or update LODA, please follow the [installation instructions](https:/
1010
### Enhancements
1111

1212
* Simplify comparison of programs (better/faster)
13+
* Include progress information in logs
1314

1415
# v22.6.27
1516

src/miner.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,20 @@ bool Miner::checkRegularTasks() {
218218
// regular task: log info
219219
if (log_scheduler.isTargetReached()) {
220220
log_scheduler.reset();
221+
std::string progress;
222+
if (progress_monitor) {
223+
const double p = 100.0 * progress_monitor->getProgress();
224+
std::stringstream buf;
225+
buf.precision(1);
226+
buf << ", " << std::fixed << p << "%";
227+
progress = buf.str();
228+
}
221229
if (num_processed) {
222230
Log::get().info("Processed " + std::to_string(num_processed) +
223-
" programs");
231+
" programs" + progress);
224232
num_processed = 0;
225233
} else {
226-
Log::get().warn("Slow processing of programs");
234+
Log::get().warn("Slow processing of programs" + progress);
227235
}
228236

229237
// regular task: report progress and check termination

0 commit comments

Comments
 (0)