You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ python3 test_log.py
Traceback (most recent call last):
File "test_log.py", line 6, in <module>
colorlog.basicConfig(level=logging.DEBUG, style='{', format=fmt, stream=None)
File "/home/csh/dev/wm/virt/lib/python3.8/site-packages/colorlog/logging.py", line 16, in basicConfig
logging.basicConfig(**kwargs)
File "/toolbox/2/tools/python-3.8.1/lib/python3.8/logging/__init__.py", line 1984, in basicConfig
fmt = Formatter(fs, dfs, style)
File "/toolbox/2/tools/python-3.8.1/lib/python3.8/logging/__init__.py", line 576, in __init__
self._style.validate()
File "/toolbox/2/tools/python-3.8.1/lib/python3.8/logging/__init__.py", line 429, in validate
raise ValueError("Invalid format '%s' for '%s' style" % (self._fmt, self.default_format[0]))
ValueError: Invalid format '{log_color}{levelname} {name}: {message}' for '%' style
Using colorlog 4.7.2
The text was updated successfully, but these errors were encountered:
I was quite suprised to find this doesn't work - the bug has been around for a very long time! It resulted from passing some formatting aguments on to the original logging.basicConfig() (format and dateformat) but not others (style).
Using
colorlog.basicConfig()
withstyle='{'
results in an error. It seems that colorlog does not send the style on to logging.Traceback
Using colorlog 4.7.2
The text was updated successfully, but these errors were encountered: