From f6448bb05d3f69190c200addebb4902e1b4c102d Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 27 Feb 2015 15:27:13 +0100 Subject: [PATCH] Turn off collored log output on windows --- gns3server/web/logger.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gns3server/web/logger.py b/gns3server/web/logger.py index f2a51484..6c9c1d2b 100644 --- a/gns3server/web/logger.py +++ b/gns3server/web/logger.py @@ -79,9 +79,12 @@ class ColouredStreamHandler(logging.StreamHandler): def init_logger(level, quiet=False): - - stream_handler = ColouredStreamHandler(sys.stdout) - stream_handler.formatter = ColouredFormatter("{asctime} {levelname} {filename}:{lineno}#RESET# {message}", "%Y-%m-%d %H:%M:%S", "{") + if sys.platform.startswith("win"): + stream_handler = logging.StreamHandler(sys.stdout) + stream_handler.formatter = ColouredFormatter("{asctime} {levelname} {filename}:{lineno} {message}", "%Y-%m-%d %H:%M:%S", "{") + else: + stream_handler = ColouredStreamHandler(sys.stdout) + stream_handler.formatter = ColouredFormatter("{asctime} {levelname} {filename}:{lineno}#RESET# {message}", "%Y-%m-%d %H:%M:%S", "{") if quiet: stream_handler.addFilter(logging.Filter(name="user_facing")) logging.getLogger('user_facing').propagate = False