Skip to content

Commit

Permalink
Merge pull request #1 from pabloa/pabloa-patch-1
Browse files Browse the repository at this point in the history
If the user defines use_colors, then it does not try to detect terminal capabilities, it just uses it.
  • Loading branch information
pabloa committed Aug 29, 2020
2 parents 3935774 + 01ae1b0 commit 980aef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coloredlogs/__init__.py
Expand Up @@ -425,12 +425,12 @@ def install(level=None, **kw):
enable_system_logging(level=syslog_enabled)
# Figure out whether we can use ANSI escape sequences.
use_colors = kw.get('isatty', None)
if use_colors or use_colors is None:
if use_colors is None:
# Try to enable Windows native ANSI support or Colorama.
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:
if 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 980aef2

Please sign in to comment.