mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
Progress indicator: Cleanup
This commit is contained in:
parent
dff12b38f9
commit
40bffe0a43
7 changed files with 105 additions and 151 deletions
|
@ -43,10 +43,6 @@ public:
|
|||
|
||||
writeToStderr(prefix + (tty ? fs.s : filterANSIEscapes(fs.s)) + "\n");
|
||||
}
|
||||
|
||||
void event(const Event & ev) override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Verbosity verbosity = lvlInfo;
|
||||
|
@ -78,22 +74,10 @@ Logger * makeDefaultLogger()
|
|||
|
||||
std::atomic<uint64_t> nextId{(uint64_t) getpid() << 32};
|
||||
|
||||
Activity::Activity() : id(nextId++) { };
|
||||
|
||||
Activity::Activity(ActivityType type, std::string msg)
|
||||
: Activity()
|
||||
Activity::Activity(Logger & logger, ActivityType type, const std::string & s)
|
||||
: logger(logger), id(nextId++)
|
||||
{
|
||||
logger->event(evStartActivity, id, type, msg);
|
||||
}
|
||||
|
||||
Activity::~Activity()
|
||||
{
|
||||
logger->event(evStopActivity, id);
|
||||
}
|
||||
|
||||
void Activity::progress(uint64_t done, uint64_t expected, uint64_t running, uint64_t failed) const
|
||||
{
|
||||
logger->event(evProgress, id, done, expected, running, failed);
|
||||
logger.startActivity(id, type, s);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue