msger: print msger.warning and msger.error info to stdout if enable catch stderr
authorZhang Qiang <qiang.z.zhang@intel.com>
Wed, 19 Oct 2011 03:42:53 +0000 (11:42 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Wed, 19 Oct 2011 03:42:53 +0000 (11:42 +0800)
mic/msger.py

index 8355805..712ff0d 100644 (file)
@@ -114,7 +114,10 @@ def _color_print(head, color, msg, stream, level):
     stream.flush()
 
 def _color_perror(head, color, msg, level = 'normal'):
-    _general_print(head, color, msg, sys.stderr, level)
+    if CATCHERR_BUFFILE_FD > 0:
+        _general_print(head, color, msg, sys.stdout, level)
+    else:
+        _general_print(head, color, msg, sys.stderr, level)
 
 def _split_msg(head, msg):
     if isinstance(msg, list):