Skip to content

Commit

Permalink
[FIX] logging: dont use color in windows cmd
Browse files Browse the repository at this point in the history
windows cmd.exe terminal doesnt display them correctly so escape sequences end
up uselessly wasting some of the precious 80 char wide screen estate.
  • Loading branch information
antonylesuisse committed Jan 9, 2015
1 parent 5a642a8 commit aeaf7ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openerp/netsvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aeaf7ef

Please sign in to comment.