add timestamp to all log lines
[electrum-server.git] / processor.py
index c6972f8..5590874 100644 (file)
@@ -17,7 +17,7 @@ print_lock = threading.Lock()
 def print_log(*args):
     args = [str(item) for item in args]
     with print_lock:
-        sys.stderr.write(" ".join(args) + "\n")
+        sys.stderr.write(timestr() + " " + " ".join(args) + "\n")
         sys.stderr.flush()
 
 
@@ -234,7 +234,7 @@ class Session:
             addr = None
 
         if self.subscriptions:
-            print_log( timestr(), self.name, self.address, addr, len(self.subscriptions), self.version )
+            print_log( "%4s"%self.name, "%14s"%self.address, "%35s"%addr, "%3d"%len(self.subscriptions), self.version )
 
     def stopped(self):
         with self.lock: