about summary refs log tree commit diff
path: root/src/libutil/logging.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-08-16T14·38+0200
committerEelco Dolstra <edolstra@gmail.com>2017-08-16T18·56+0200
commit40bffe0a43e5f2f320c6bae7e39ea9c26906451d (patch)
tree6e7d46a8b252201bd1ca0632e167f5e76ef0aab5 /src/libutil/logging.cc
parentdff12b38f9d836fd0a58abc41286a9ad6b602aa5 (diff)
Progress indicator: Cleanup
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r--src/libutil/logging.cc22
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);
 }
 
 }