aboutsummaryrefslogtreecommitdiff
path: root/build/trace
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-14 11:39:21 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-14 11:39:21 +0200
commitce8a94e6a76097ef7eeb34df4257991a20599712 (patch)
tree5e83b9d083f486a6efe889102f7c2a815e6a06c6 /build/trace
parentab4421747146aa7995f0cfb1a639c9121c82c915 (diff)
Track file extension in target, prerequisite
Diffstat (limited to 'build/trace')
-rw-r--r--build/trace13
1 files changed, 11 insertions, 2 deletions
diff --git a/build/trace b/build/trace
index f1c0567..1764a69 100644
--- a/build/trace
+++ b/build/trace
@@ -34,9 +34,11 @@ namespace build
return std::cerr << x;
}
+ explicit record (tracer& t): empty_ (false) {t.begin ();}
+ explicit record (bool e = true): empty_ (e) {}
+
// Movable-only type.
//
- explicit record (bool e = true): empty_ (e) {}
record (record&& r) {empty_ = r.empty_; r.empty_ = true;}
record& operator= (record&& r) {empty_ = r.empty_; r.empty_ = true;}
@@ -51,10 +53,17 @@ namespace build
record
operator<< (const T& x) const
{
- std::cerr << "trace: " << name_ << ": " << x;
+ begin ();
+ std::cerr << x;
return record (false);
}
+ void
+ begin () const
+ {
+ std::cerr << "trace: " << name_ << ": ";
+ }
+
private:
const char* name_;
};