mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
Give activities a verbosity level again
And print them (separately from the progress bar) given sufficient -v flags.
This commit is contained in:
parent
cfc8132391
commit
2cc345b95f
10 changed files with 41 additions and 19 deletions
|
@ -45,6 +45,13 @@ public:
|
|||
|
||||
writeToStderr(prefix + (tty ? fs.s : filterANSIEscapes(fs.s)) + "\n");
|
||||
}
|
||||
|
||||
void startActivity(ActivityId act, Verbosity lvl, ActivityType type,
|
||||
const std::string & s, const Fields & fields, ActivityId parent)
|
||||
{
|
||||
if (lvl <= verbosity && !s.empty())
|
||||
log(lvl, s + "...");
|
||||
}
|
||||
};
|
||||
|
||||
Verbosity verbosity = lvlInfo;
|
||||
|
@ -76,11 +83,11 @@ Logger * makeDefaultLogger()
|
|||
|
||||
std::atomic<uint64_t> nextId{(uint64_t) getpid() << 32};
|
||||
|
||||
Activity::Activity(Logger & logger, ActivityType type,
|
||||
Activity::Activity(Logger & logger, Verbosity lvl, ActivityType type,
|
||||
const std::string & s, const Logger::Fields & fields, ActivityId parent)
|
||||
: logger(logger), id(nextId++)
|
||||
{
|
||||
logger.startActivity(id, type, s, fields, parent);
|
||||
logger.startActivity(id, lvl, type, s, fields, parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue