Browse Source

Outout in one line :)

Andrés J. Díaz 7 years ago
parent
commit
f9029dc7d5
1 changed files with 15 additions and 6 deletions
  1. 15 6
      mico/output.py

+ 15 - 6
mico/output.py

@@ -93,40 +93,49 @@ def label():
 def stack():
     return inspect.stack()[2][3]
 
+def fmessage(message):
+    return repr(message)
+
 
 def abort(message):
     if "abort" in env.loglevel:
-        print >> sys.stderr, "%s%s: %s: %s" % (prompt_err, label(), stack(), message)
+        print >> sys.stderr, "%s%s: %s: %s" % (prompt_err,
+                label(), stack(), fmessage(message))
     return message
 
 
 def error(message, *args, **kwargs):
     if "error" in env.loglevel:
-        print >> sys.stderr, "%s%s: %s: %s" % (prompt_err, label(), stack(), message)
+        print >> sys.stderr, "%s%s: %s: %s" % (prompt_err,
+                label(), stack(), fmessage(message))
     return message
 
 
 def warn(message):
     if "warn" in env.loglevel:
-        print >> sys.stderr, "%s%s: %s: %s" % (prompt_inf, label(), stack(), message)
+        print >> sys.stderr, "%s%s: %s: %s" % (prompt_inf,
+                label(), stack(), fmessage(message))
     return message
 
 
 def puts(message, *args, **kwargs):
     if "info" in env.loglevel:
-        print >> sys.stderr, "%s%s: %s: %s" % (prompt_inf, label(), stack(), message)
+        print >> sys.stderr, "%s%s: %s: %s" % (prompt_inf,
+                label(), stack(), fmessage(message))
     return message
 
 
 def info(message, *args, **kwargs):
     if "info" in env.loglevel:
-        print >> sys.stdout, "%s%s: %s: %s" % (prompt_msg, label(), stack(), message)
+        print >> sys.stdout, "%s%s: %s: %s" % (prompt_msg,
+                label(), stack(), fmessage(message))
     return message
 
 
 def debug(message):
     if "debug" in env.loglevel:
-        print >> sys.stdout, "%s%s: %s: %s" % (prompt_dbg, label(), stack(), message)
+        print >> sys.stdout, "%s%s: %s: %s" % (prompt_dbg,
+                label(), stack(), fmessage(message))
     return message