Skip to content

Commit

Permalink
respect isatty parameter
Browse files Browse the repository at this point in the history
respect isatty parameter to force enable ANSI escape sequence
fix issue #85
  • Loading branch information
sudoerChris committed Aug 3, 2020
1 parent 3935774 commit 9c7d35d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion coloredlogs/__init__.py
Expand Up @@ -430,7 +430,8 @@ def install(level=None, **kw):
if on_windows():
use_colors = enable_ansi_support()
# Disable ANSI escape sequences if 'stream' isn't connected to a terminal.
if use_colors or use_colors is None:
isatty = kw.get('isatty', False)
if (not isatty) and (use_colors or use_colors is None):
use_colors = terminal_supports_colors(stream)
# Create a stream handler.
handler = logging.StreamHandler(stream) if stream else StandardErrorHandler()
Expand Down

0 comments on commit 9c7d35d

Please sign in to comment.