diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-10-27 09:49:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-10-27 09:49:13 +0200 |
commit | 9f90ce8de8865bd111191bf6fd7434ef6d3b75ab (patch) | |
tree | 18bf1eec2b89b1f9d0229f8be20db2cb5c56d850 /libbutl/diagnostics.hxx | |
parent | b7f32cea30174e391027fecc9d431ca16b2f87c2 (diff) |
Add ability to use custom writer when flushing diag_record
Diffstat (limited to 'libbutl/diagnostics.hxx')
-rw-r--r-- | libbutl/diagnostics.hxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libbutl/diagnostics.hxx b/libbutl/diagnostics.hxx index 23aa14f..574695c 100644 --- a/libbutl/diagnostics.hxx +++ b/libbutl/diagnostics.hxx @@ -27,8 +27,11 @@ namespace butl LIBBUTL_SYMEXPORT extern std::ostream* diag_stream; // Acquire the diagnostics exclusive access mutex in ctor, release in dtor. - // An object of the type must be created prior to writing to diag_stream (see - // above). + // An object of the type must be created prior to writing to diag_stream + // (see above). + // + // Note that this class also manages the interaction with the progress + // printing (see below). // struct LIBBUTL_SYMEXPORT diag_stream_lock { @@ -128,8 +131,10 @@ namespace butl bool full () const {return !empty_;} + // Note that currently the passed writer is not passed to the epilogue. + // void - flush () const; + flush (void (*writer) (const diag_record&) = nullptr) const; void append (const char* indent, diag_epilogue* e) const |