about summary refs log tree commit diff
path: root/src/libutil/logging.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/logging.hh')
-rw-r--r--src/libutil/logging.hh16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libutil/logging.hh b/src/libutil/logging.hh
index aa407f60bb65..6a4a36171560 100644
--- a/src/libutil/logging.hh
+++ b/src/libutil/logging.hh
@@ -14,6 +14,7 @@ typedef enum {
 } Verbosity;
 
 typedef enum {
+    actUnknown = 0,
     actCopyPath = 100,
 } ActivityType;
 
@@ -28,7 +29,8 @@ public:
     Activity(ActivityType type, std::string msg = "");
     ~Activity();
 
-    //void progress(...);
+    template<typename... Args>
+    void progress(const Args & ... args);
 };
 
 typedef enum {
@@ -49,6 +51,8 @@ typedef enum {
 
     evStartActivity = 1000,
     evStopActivity = 1001,
+    evProgress = 1002,
+    evSetExpected = 1003,
 
 } EventType;
 
@@ -149,4 +153,14 @@ void warnOnce(bool & haveWarned, const FormatOrString & fs);
 
 void writeToStderr(const string & s);
 
+template<typename... Args>
+void Activity::progress(const Args & ... args)
+{
+    Event ev;
+    ev.type = evProgress;
+    ev.fields.emplace_back(id);
+    nop{(ev.fields.emplace_back(Event::Field(args)), 1)...};
+    logger->event(ev);
+}
+
 }