Skip to content

Commit

Permalink
Log formatter should not combine lines starting "[\s*\S+\s*]"
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiirola committed Jun 17, 2020
1 parent c0b323e commit ac33f23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pyutilib/misc/log_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import textwrap

_indention = re.compile('\s*')
_status_re = re.compile('^\[\s*[A-Za-z0-9\.]+\s*\]')

class LogHandler(logging.Handler):

Expand Down Expand Up @@ -74,9 +75,10 @@ def emit(self, record):
# Blank lines reset the indentation level
indent = None
elif indent == leading:
# Catch things like bulleted lists
if len(content) > 1 and par_lines and content[1] == ' ' \
and content[0] in '-* ':
# Catch things like bulleted lists and '[FAIL]'
if len(content) > 1 and par_lines and (
(content[1] == ' ' and content[0] in '-* ') or
(content[0] == '[' and _status_re.match(content))):
paragraphs.append((indent, par_lines))
par_lines = []
par_lines.append( content )
Expand Down

0 comments on commit ac33f23

Please sign in to comment.