aboutsummaryrefslogtreecommitdiff
path: root/build2/diagnostics.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-22 12:10:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-22 12:10:03 +0200
commit557269660c1d9796a7cf9e911efb9262f645e359 (patch)
tree0323bcb5a90c339fe87fcd193cf71bdcb3431c91 /build2/diagnostics.cxx
parentfae6cd2235c907e077dad7b5d8dc9b6d90a78a37 (diff)
Use diagnostics facility from libbutl
Diffstat (limited to 'build2/diagnostics.cxx')
-rw-r--r--build2/diagnostics.cxx36
1 files changed, 6 insertions, 30 deletions
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 <build2/diagnostics>
#include <cstring> // strchr()
-#include <iostream>
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<failed> 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;
}