From 557269660c1d9796a7cf9e911efb9262f645e359 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Nov 2016 12:10:03 +0200 Subject: Use diagnostics facility from libbutl --- build2/diagnostics.cxx | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'build2/diagnostics.cxx') diff --git a/build2/diagnostics.cxx b/build2/diagnostics.cxx index dfd792e..0009ff7 100644 --- a/build2/diagnostics.cxx +++ b/build2/diagnostics.cxx @@ -5,7 +5,6 @@ #include #include // strchr() -#include using namespace std; @@ -45,29 +44,6 @@ namespace build2 // uint16_t verb; - // Diagnostic facility, base infrastructure. - // - ostream* diag_stream = &cerr; - - diag_record:: - ~diag_record () noexcept(false) - { - // Don't flush the record if this destructor was called as part of - // the stack unwinding. Right now this means we cannot use this - // mechanism in destructors, which is not a big deal, except for - // one place: exception_guard. So for now we are going to have - // this ugly special check which we will be able to get rid of - // once C++17 uncaught_exceptions() becomes available. - // - if (!empty_ && (!std::uncaught_exception () || exception_unwinding_dtor)) - { - *diag_stream << os.str () << endl; - - if (epilogue_ != nullptr) - epilogue_ (*this); // Can throw. - } - } - // Diagnostic facility, project specifics. // @@ -117,10 +93,10 @@ namespace build2 r << name_ << ": "; } - const basic_mark error (&stream_verb_map, "error"); - const basic_mark warn (&stream_verb_map, "warning"); - const basic_mark info (&stream_verb_map, "info"); - const basic_mark text (&stream_verb_map, nullptr); - - const fail_mark fail; + const basic_mark error ("error"); + const basic_mark warn ("warning"); + const basic_mark info ("info"); + const basic_mark text (nullptr); + const fail_mark fail ("error"); + const fail_end endf; } -- cgit v1.1