1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 15:51:15 +02:00

Progress indicator: Show number of active items

This commit is contained in:
Eelco Dolstra 2017-08-14 22:42:17 +02:00
parent 0e0dcf2c7e
commit bf1f123b09
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 39 additions and 28 deletions

View file

@ -32,8 +32,7 @@ public:
Activity(ActivityType type, std::string msg = "");
~Activity();
template<typename... Args>
void progress(const Args & ... args) const;
void progress(uint64_t done = 0, uint64_t expected = 0, uint64_t running = 0, uint64_t failed = 0) const;
};
typedef enum {
@ -146,14 +145,4 @@ void warnOnce(bool & haveWarned, const FormatOrString & fs);
void writeToStderr(const string & s);
template<typename... Args>
void Activity::progress(const Args & ... args) const
{
Event ev;
ev.type = evProgress;
ev.fields.emplace_back(id);
nop{(ev.fields.emplace_back(Event::Field(args)), 1)...};
logger->event(ev);
}
}