mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 07:23:47 +02:00
Turn off collored log output on windows
This commit is contained in:
parent
ebb865d973
commit
f6448bb05d
@ -79,9 +79,12 @@ class ColouredStreamHandler(logging.StreamHandler):
|
|||||||
|
|
||||||
|
|
||||||
def init_logger(level, quiet=False):
|
def init_logger(level, quiet=False):
|
||||||
|
if sys.platform.startswith("win"):
|
||||||
stream_handler = ColouredStreamHandler(sys.stdout)
|
stream_handler = logging.StreamHandler(sys.stdout)
|
||||||
stream_handler.formatter = ColouredFormatter("{asctime} {levelname} {filename}:{lineno}#RESET# {message}", "%Y-%m-%d %H:%M:%S", "{")
|
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:
|
if quiet:
|
||||||
stream_handler.addFilter(logging.Filter(name="user_facing"))
|
stream_handler.addFilter(logging.Filter(name="user_facing"))
|
||||||
logging.getLogger('user_facing').propagate = False
|
logging.getLogger('user_facing').propagate = False
|
||||||
|
Loading…
Reference in New Issue
Block a user