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

Improve progress indicator

This commit is contained in:
Eelco Dolstra 2017-05-16 16:09:57 +02:00
parent e80257f122
commit b01d62285c
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
26 changed files with 339 additions and 168 deletions

View file

@ -1,6 +1,8 @@
#include "logging.hh"
#include "util.hh"
#include <atomic>
namespace nix {
Logger * logger = makeDefaultLogger();
@ -42,12 +44,7 @@ public:
writeToStderr(prefix + (tty ? fs.s : filterANSIEscapes(fs.s)) + "\n");
}
void startActivity(Activity & activity, Verbosity lvl, const FormatOrString & fs) override
{
log(lvl, fs);
}
void stopActivity(Activity & activity) override
void event(const Event & ev) override
{
}
};
@ -79,4 +76,8 @@ Logger * makeDefaultLogger()
return new SimpleLogger();
}
std::atomic<uint64_t> Activity::nextId{(uint64_t) getpid() << 32};
Activity::Activity() : id(nextId++) { };
}