diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-25 09:38:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-25 09:38:40 +0200 |
commit | 73fd1a275b7ed039ef3ca18a3706692e9e95177a (patch) | |
tree | 1565fca68586c4c23ac6ceedc507f8aed93e7d13 /libbuild2/module.cxx | |
parent | aca0c7906724b2c0b648c06604e60fc3164e6f6a (diff) |
Add --silent, remap verbosity 0 to 1 while building modules unless silent
Failed that, we may have long periods of seemingly nothing happening (e.g.,
during implicit bdep sync) while we quietly update the module, which may look
like things have hung up.
Diffstat (limited to 'libbuild2/module.cxx')
-rw-r--r-- | libbuild2/module.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx index b73ddb3..50c6d53 100644 --- a/libbuild2/module.cxx +++ b/libbuild2/module.cxx @@ -262,6 +262,21 @@ namespace build2 ? scheduler::tune_guard (ctx.sched, 0) : scheduler::tune_guard ()); + // Remap verbosity level 0 to 1 unless we were requested to be + // silent. Failed that, we may have long periods of seemingly + // nothing happening while we quietly update the module, which + // may look like things have hung up. + // + // @@ CTX: modifying global verbosity level won't work if we have + // multiple top-level contexts running in parallel. + // + auto verbg = make_guard ( + [z = !silent && verb == 0 ? (verb = 1, true) : false] () + { + if (z) + verb = 0; + }); + // Note that for now we suppress progress since it would clash with // the progress of what we are already doing (maybe in the future we // can do save/restore but then we would need some sort of |