Skip to content

Commit

Permalink
Merge pull request #30542 from gladiatr72/fix_off-posix_log-level_exc…
Browse files Browse the repository at this point in the history
…eptions

address color log dict lookup exceptions w/ non-posix log level names
  • Loading branch information
Mike Place committed Jan 22, 2016
2 parents 8069863 + de4ae26 commit d0d01fe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions salt/log/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,20 @@ def __init__(self, *args, **kwargs):
logging.LogRecord.__init__(self, *args, **kwargs)
reset = TextFormat('reset')

clevel = LOG_COLORS['levels'].get(self.levelname, reset)
cmsg = LOG_COLORS['msgs'].get(self.levelname, reset)

# pylint: disable=E1321
self.colorname = '%s[%-17s]%s' % (LOG_COLORS['name'],
self.name,
reset)
self.colorlevel = '%s[%-8s]%s' % (LOG_COLORS['levels'][self.levelname],
self.colorlevel = '%s[%-8s]%s' % (clevel,
self.levelname,
TextFormat('reset'))
self.colorprocess = '%s[%5s]%s' % (LOG_COLORS['process'],
self.process,
reset)
self.colormsg = '%s%s%s' % (LOG_COLORS['msgs'][self.levelname],
self.msg,
reset)
self.colormsg = '%s%s%s' % (cmsg, self.msg, reset)
# pylint: enable=E1321


Expand Down

0 comments on commit d0d01fe

Please sign in to comment.