mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
Allow activities to be nested
In particular, this allows more relevant activities ("substituting X") to supersede inferior ones ("downloading X").
This commit is contained in:
parent
f194629f96
commit
c137c0a5eb
7 changed files with 55 additions and 12 deletions
|
@ -5,6 +5,8 @@
|
|||
|
||||
namespace nix {
|
||||
|
||||
thread_local ActivityId curActivity = 0;
|
||||
|
||||
Logger * logger = makeDefaultLogger();
|
||||
|
||||
void Logger::warn(const std::string & msg)
|
||||
|
@ -75,10 +77,10 @@ Logger * makeDefaultLogger()
|
|||
std::atomic<uint64_t> nextId{(uint64_t) getpid() << 32};
|
||||
|
||||
Activity::Activity(Logger & logger, ActivityType type,
|
||||
const std::string & s, const Logger::Fields & fields)
|
||||
const std::string & s, const Logger::Fields & fields, ActivityId parent)
|
||||
: logger(logger), id(nextId++)
|
||||
{
|
||||
logger.startActivity(id, type, s, fields);
|
||||
logger.startActivity(id, type, s, fields, parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue