Skip to content

Commit

Permalink
Revert "Enables the option for color to be displayed for warnings and…
Browse files Browse the repository at this point in the history
… errors."

This reverts commit 126393c.
  • Loading branch information
Barret Rennie committed Jan 12, 2017
1 parent fc5e255 commit 6031fa3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 54 deletions.
52 changes: 1 addition & 51 deletions rbtools/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import subprocess
import sys

from colorlog import ColoredFormatter
from six.moves import input
from six.moves.urllib.parse import urlparse

Expand Down Expand Up @@ -179,30 +178,6 @@ class Command(object):
help='Displays debug output.',
extended_help='This information can be valuable when debugging '
'problems running the command.'),
OptionGroup(
name='RBTools Warning and Error Color Options',
description='Default color settings for warnings and errors',
option_list=[
Option('--color',
dest='color',
config_key='COLOR',
default='auto',
help='Enables color output.',
extended_help='Enables color output on terminal.'),
Option('--log-warn-color',
dest='warn_color',
config_key='LOG_WARNING_COLOR',
default='yellow'),
Option('--log-error-color',
dest='error_color',
config_key='LOG_ERROR_COLOR',
default='red'),
Option('--log-critical-color',
dest='critical_color',
config_key='LOG_CRITICAL_COLOR',
default='bold_red'),
]
)
]

server_options = OptionGroup(
Expand Down Expand Up @@ -626,32 +601,7 @@ def init_logging(self):
# Handler for warnings, errors, and criticals. They'll show the
# level prefix and the message.
handler = logging.StreamHandler()

if (self.options.color == 'always' or
(self.options.color == 'auto' and
sys.stderr.isatty())):
handler.setFormatter(ColoredFormatter(
'%(log_color)s%(levelname)-8s%(reset)s'
'%(message_log_color)s%(message)s',
datefmt=None,
reset=True,
log_colors={
'WARNING': self.options.warn_color,
'ERROR': self.options.error_color,
'CRITICAL': self.options.critical_color,
},
secondary_log_colors={
'message': {
'WARNING': self.options.warn_color,
'ERROR': self.options.error_color,
'CRITICAL': self.options.critical_color,
}
},
style='%'
))
else:
handler.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))

handler.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
handler.setLevel(logging.WARNING)
root.addHandler(handler)

Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@

install_requires = [
'backports.shutil_get_terminal_size',
'colorlog',
'colorama',
'six>=1.8.0',
'texttable',
'tqdm',
Expand Down Expand Up @@ -82,7 +80,6 @@
'clear-cache = rbtools.commands.clearcache:ClearCache',
'close = rbtools.commands.close:Close',
'diff = rbtools.commands.diff:Diff',
'install = rbtools.commands.install:Install',
'land = rbtools.commands.land:Land',
'list-repo-types = rbtools.commands.list_repo_types:ListRepoTypes',
'login = rbtools.commands.login:Login',
Expand Down

0 comments on commit 6031fa3

Please sign in to comment.