aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/adhoc-rule-cxx.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-11-16 07:52:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-11-16 07:52:11 +0200
commitf80c8ff7ff3b1eef22a3c90943f324d45d855b97 (patch)
treef44a25aa71de05e11c417dcc01cc3f6b9eca97ee /libbuild2/adhoc-rule-cxx.cxx
parent44b0a5989f76570fc19dc41314f31c4fa9c2039b (diff)
Initial low verbosity diagnostics rework
Diffstat (limited to 'libbuild2/adhoc-rule-cxx.cxx')
-rw-r--r--libbuild2/adhoc-rule-cxx.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/libbuild2/adhoc-rule-cxx.cxx b/libbuild2/adhoc-rule-cxx.cxx
index 8230fd8..5c08a09 100644
--- a/libbuild2/adhoc-rule-cxx.cxx
+++ b/libbuild2/adhoc-rule-cxx.cxx
@@ -326,6 +326,17 @@ namespace build2
if (!create && (create = !check_sig (bf, psig)))
rmdir_r (ctx, pd, false, verbosity); // Never dry-run.
+ auto diag = [verbosity] (const path& f)
+ {
+ if (verb >= verbosity)
+ {
+ if (verb >= 2)
+ text << "cat >" << f;
+ else if (verb)
+ print_diag ("save", f);
+ }
+ };
+
path of;
ofdstream ofs;
@@ -356,8 +367,7 @@ namespace build2
//
of = path (pd / "rule.cxx");
- if (verb >= verbosity)
- text << (verb >= 2 ? "cat >" : "save ") << of;
+ diag (of);
ofs.open (of);
@@ -487,8 +497,7 @@ namespace build2
//
of = bf;
- if (verb >= verbosity)
- text << (verb >= 2 ? "cat >" : "save ") << of;
+ diag (of);
ofs.open (of);
@@ -560,8 +569,7 @@ namespace build2
entry_time et (file_time (of));
- if (verb >= verbosity)
- text << (verb >= 2 ? "cat >" : "save ") << of;
+ diag (of);
ofs.open (of);