Skip to content

Commit

Permalink
Honor NO_COLOR environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brant Watson committed Feb 12, 2018
1 parent c7707ce commit 0092b0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/log_color/colors.py
Expand Up @@ -51,6 +51,10 @@ def color_supported(force_seq=None):
if force_seq is False or force_seq is True:
return force_seq

# Honor NO_COLOR environment variable:
if os.environ.get('NO_COLOR', None):
return False

# Attempt simple autodetection
if (
(hasattr(sys.stderr, "isatty") and sys.stderr.isatty()) or
Expand Down

0 comments on commit 0092b0a

Please sign in to comment.