aboutsummaryrefslogtreecommitdiff
path: root/build/diagnostics.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-20 13:01:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-20 13:01:46 +0200
commita82cdb8fd9ba02034d296769772cdf81244da66a (patch)
tree2cd5fb0211984716780ce5fad18c19d7c4d9a794 /build/diagnostics.cxx
parentc775a7f28a56ef96f097e677434eceec9d8f2cdf (diff)
Automatically decide when to print relative/absolute paths
Diffstat (limited to 'build/diagnostics.cxx')
-rw-r--r--build/diagnostics.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/build/diagnostics.cxx b/build/diagnostics.cxx
index bc157ed..0dfae1a 100644
--- a/build/diagnostics.cxx
+++ b/build/diagnostics.cxx
@@ -75,6 +75,10 @@ namespace build
return r;
}
+ // Relative stream.
+ //
+ const int relative_index = ostream::xalloc ();
+
// diag_do(), etc.
//
string
@@ -194,6 +198,8 @@ namespace build
void simple_prologue_base::
operator() (const diag_record& r) const
{
+ relative (r.os_, relative_);
+
if (type_ != nullptr)
r << type_ << ": ";
@@ -204,6 +210,8 @@ namespace build
void location_prologue_base::
operator() (const diag_record& r) const
{
+ relative (r.os_, relative_);
+
r << loc_.file << ':' << loc_.line << ':' << loc_.column << ": ";
if (type_ != nullptr)
@@ -216,7 +224,6 @@ namespace build
const basic_mark error ("error");
const basic_mark warn ("warning");
const basic_mark info ("info");
- const basic_mark text (nullptr);
-
+ const text_mark text;
const fail_mark<failed> fail;
}