about summary refs log tree commit diff
path: root/src/libutil/logging.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-05-16T14·09+0200
committerEelco Dolstra <edolstra@gmail.com>2017-05-16T14·09+0200
commitb01d62285cdcd376a8db1863049c68d8c7238837 (patch)
tree97662479c20edb683e81f82b26635915703da3ca /src/libutil/logging.cc
parente80257f12209c8fbb709b901039ef5199111276e (diff)
Improve progress indicator
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r--src/libutil/logging.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index afcc2ec58543..2d0acca24216 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -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++) { };
+
 }