diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-21 10:29:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-21 10:29:03 +0200 |
commit | 0dc03d406a9958adb27ff49f568685f6e80f01ce (patch) | |
tree | fe51d02935c81a27ffd82f21d0d4275432019ffe /build2/diagnostics.hxx | |
parent | 75fc95426f2028044f3e1fccef261e76cda69892 (diff) |
Add progress to dist meta-operation
Diffstat (limited to 'build2/diagnostics.hxx')
-rw-r--r-- | build2/diagnostics.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/build2/diagnostics.hxx b/build2/diagnostics.hxx index b9757d6..5ec2ef0 100644 --- a/build2/diagnostics.hxx +++ b/build2/diagnostics.hxx @@ -143,6 +143,22 @@ namespace build2 os.iword (stream_verb_index) = static_cast<long> (v.value_) + 1; } + // Progress reporting. + // + using butl::diag_progress; + using butl::diag_progress_lock; + + // Return true if progress is to be shown. The max_verb argument is the + // maximum verbosity level that this type of progress should be shown by + // default. + // + inline bool + show_progress (uint16_t max_verb) + { + return ops.progress () || + (stderr_term && verb >= 1 && verb <= max_verb && !ops.no_progress ()); + } + // Diagnostic facility, base infrastructure. // using butl::diag_stream_lock; |