ea7e0d0fb085 — Steve Fink 3 years ago
Localize control of some logging garbage
1 files changed, 8 insertions(+), 7 deletions(-)

M plugins/pulse/__init__.py
M plugins/pulse/__init__.py +8 -7
@@ 120,6 120,8 @@ class PulsePlugin(Plugin):
 
         self.lastBuildState = {}
 
+
+        self.msglog = None
         if False:
             try:
                 os.mkdir("/tmp/pulses")

          
@@ 227,13 229,12 @@ class PulsePlugin(Plugin):
         ch,method,properties,body = yield queue_object.get()
         routes = properties.headers.get('CC', [])
         routes.append(method.routing_key)
-        if body:
-            if False:
-                self.msglog.write(body)
-                self.msglog.write("\n")
-                self.msglog.write("%r" % (routes,))
-                self.msglog.write("\n")
-                self.msglog.write("\n")
+        if body and self.msglog:
+            self.msglog.write(body)
+            self.msglog.write("\n")
+            self.msglog.write("%r" % (routes,))
+            self.msglog.write("\n")
+            self.msglog.write("\n")
 
             data = json.loads(body)
             data['routes'] = routes