Skip to content

Commit

Permalink
Removes colors produces by the logger.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Oct 14, 2021
1 parent b0446a9 commit d960f29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions meta_package_manager/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from boltons.cacheutils import LRI, cached
from cloup import Context, HelpFormatter, HelpTheme, Style, group
from boltons.strutils import complement_int_list, int_ranges_from_int_list
from click_log import ColorFormatter

from . import CLI_NAME, __version__, env_data, logger, reset_logger
from .base import CLI_FORMATS, CLIError, PackageManager
Expand Down Expand Up @@ -209,6 +210,10 @@ def cli(
# Take timestamp snapshot.
start_time = perf_counter() if time else None

# Neutralize color by removing configuration for each levels.
if no_color:
ColorFormatter.colors = {level: {} for level in ColorFormatter.colors}

# Print log level.
level = logger.level
level_name = logging._levelToName.get(level, level)
Expand Down

0 comments on commit d960f29

Please sign in to comment.