From 9f90ce8de8865bd111191bf6fd7434ef6d3b75ab Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Oct 2022 09:49:13 +0200 Subject: Add ability to use custom writer when flushing diag_record --- libbutl/diagnostics.hxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libbutl/diagnostics.hxx') 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 -- cgit v1.1