prefix logged errors instead of separating them with an empty line
authorTimo Savola <tsavola@movial.fi>
Tue, 8 Apr 2008 15:11:07 +0000 (18:11 +0300)
committerTimo Savola <tsavola@movial.fi>
Tue, 8 Apr 2008 15:11:42 +0000 (18:11 +0300)
bin/matrix
matrix/log.py

index f948b7d..3ac8fb2 100755 (executable)
@@ -25,7 +25,7 @@ except RuntimeError, e:
                log.error(msg)
 
 except KeyboardInterrupt:
-       log.error('Interrupted')
+       log.message('Interrupted')
 
 if log.dump():
        sys.exit(1)
index e56cf5f..45173f9 100644 (file)
@@ -5,14 +5,16 @@ import sys
 
 messages = []
 
-def error(msg):
+def message(msg):
        messages.append(msg)
 
+def error(msg):
+       messages.append('Error: ' + msg)
+
 def dump():
        global messages
 
        if messages:
-               print >>sys.stderr
                for msg in messages:
                        print >>sys.stderr, msg