diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-01 16:46:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-01 16:46:03 +0200 |
commit | a133e7b03bd67c992cfb240bd300967ffab31ba2 (patch) | |
tree | 02c54f4c9b7f48aeb5230e230a4bb00bb1609c2c /bbot/diagnostics.cxx | |
parent | 2ae123ce8e8a874ada7e8c776abfc0742d862277 (diff) |
Setup build infra
Diffstat (limited to 'bbot/diagnostics.cxx')
-rw-r--r-- | bbot/diagnostics.cxx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/bbot/diagnostics.cxx b/bbot/diagnostics.cxx new file mode 100644 index 0000000..1aa58f0 --- /dev/null +++ b/bbot/diagnostics.cxx @@ -0,0 +1,47 @@ +// file : bbot/diagnostics.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include <bbot/diagnostics> + +using namespace std; +using namespace butl; + +namespace bbot +{ + // Diagnostics verbosity level. + // + uint16_t verb; + + // Diagnostic facility, project specifics. + // + + void simple_prologue_base:: + operator() (const diag_record& r) const + { + if (type_ != nullptr) + r << type_ << ": "; + + if (name_ != nullptr) + r << name_ << ": "; + } + + void location_prologue_base:: + operator() (const diag_record& r) const + { + r << loc_.file << ':' << loc_.line << ':' << loc_.column << ": "; + + if (type_ != nullptr) + r << type_ << ": "; + + if (name_ != nullptr) + r << name_ << ": "; + } + + 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; +} |