Rewrote threaded log code to be more idiomatic.
[invirt/third/libt4.git] / log.cc
diff --git a/log.cc b/log.cc
index 3b881fa..c9af175 100644 (file)
--- a/log.cc
+++ b/log.cc
@@ -16,7 +16,7 @@ void log::logread(void) {
     string type;
     unsigned instance;
 
-    LOG("logread");
+    LOG << "logread";
     while (from >> type) {
         if (type == "done") {
             string v;
@@ -25,23 +25,23 @@ void log::logread(void) {
             getline(from, v);
             pxs->values[instance] = v;
             pxs->instance_h = instance;
-            LOG("logread: instance: " << instance << " w. v = " <<
-                    pxs->values[instance]);
+            LOG << "logread: instance: " << instance << " w. v = "
+                << pxs->values[instance];
             pxs->accepted_value.clear();
             pxs->promise.n = 0;
             pxs->accepted.n = 0;
         } else if (type == "propseen") {
             from >> pxs->promise.n >> pxs->promise.m;
-            LOG("logread: high update: " << pxs->promise.n << "(" << pxs->promise.m << ")");
+            LOG << "logread: high update: " << pxs->promise.n << "(" << pxs->promise.m << ")";
         } else if (type == "accepted") {
             string v;
             from >> pxs->accepted.n >> pxs->accepted.m;
             from.get();
             getline(from, v);
             pxs->accepted_value = v;
-            LOG("logread: prop update " << pxs->accepted.n << "(" << pxs->accepted.m << ") with v = " << pxs->accepted_value);
+            LOG << "logread: prop update " << pxs->accepted.n << "(" << pxs->accepted.m << ") with v = " << pxs->accepted_value;
         } else {
-            LOG("logread: unknown log record");
+            LOG << "logread: unknown log record";
             VERIFY(0);
         }
     } 
@@ -59,7 +59,7 @@ string log::dump() {
 }
 
 void log::restore(string s) {
-    LOG("restore: " << s);
+    LOG << "restore: " << s;
     ofstream f(name, ios::trunc);
     f << s;
     f.close();