1
0
Fork 0
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:
Eelco Dolstra 2017-08-25 17:49:40 +02:00
parent f194629f96
commit c137c0a5eb
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 55 additions and 12 deletions

View file

@ -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);
}
}