Skip to content

Commit

Permalink
Bug fix for log format colorization (fixes #9)
Browse files Browse the repository at this point in the history
Rationale: I'm not validating the format, I just want to extract the
referenced field names, so looking for %(..) without a trailing type
specifier (and optional modifiers) is fine here.
  • Loading branch information
xolox committed Oct 24, 2015
1 parent 275e96a commit 2630d70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coloredlogs/__init__.py
@@ -1,7 +1,7 @@
# Colored terminal output for Python's logging module.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: October 23, 2015
# Last Change: October 24, 2015
# URL: https://coloredlogs.readthedocs.org

"""
Expand Down Expand Up @@ -103,7 +103,7 @@
"""

# Semi-standard module versioning.
__version__ = '3.1.1'
__version__ = '3.1.2'

# Standard library modules.
import collections
Expand Down Expand Up @@ -600,7 +600,7 @@ def colorize_format(self, fmt):
result = []
for token in fmt.split():
# Look for field names in the token.
for match in re.finditer(r'%\((\w+)\)\w', token):
for match in re.finditer(r'%\((\w+)\)', token):
# Check if a style is defined for the matched field name.
style = self.nn.get(self.field_styles, match.group(1))
if style:
Expand Down

0 comments on commit 2630d70

Please sign in to comment.