diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-08-16T14·38+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-08-16T18·56+0200 |
commit | 40bffe0a43e5f2f320c6bae7e39ea9c26906451d (patch) | |
tree | 6e7d46a8b252201bd1ca0632e167f5e76ef0aab5 /src/libutil/logging.cc | |
parent | dff12b38f9d836fd0a58abc41286a9ad6b602aa5 (diff) |
Progress indicator: Cleanup
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r-- | src/libutil/logging.cc | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index ed83770a14aa..900f24e4cbdf 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -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() -{ - 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 +Activity::Activity(Logger & logger, ActivityType type, const std::string & s) + : logger(logger), id(nextId++) { - logger->event(evProgress, id, done, expected, running, failed); + logger.startActivity(id, type, s); } } |