[FIX] logging: dont use color in windows cmd

windows cmd.exe terminal doesnt display them correctly so escape sequences end
up uselessly wasting some of the precious 80 char wide screen estate.
This commit is contained in:
Antony Lesuisse 2015-01-09 01:44:14 +01:00
parent 5a642a802e
commit aeaf7ef914
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ def init_logger():
def is_a_tty(stream):
return hasattr(stream, 'fileno') and os.isatty(stream.fileno())
if isinstance(handler, logging.StreamHandler) and is_a_tty(handler.stream):
if os.name == 'posix' and isinstance(handler, logging.StreamHandler) and is_a_tty(handler.stream):
formatter = ColoredFormatter(format)
else:
formatter = DBFormatter(format)