python-json-logger icon indicating copy to clipboard operation
python-json-logger copied to clipboard

Fix regex for string template style

Open Thomasillo opened this issue 1 year ago • 1 comments

valid String template: '$asctime $level $message'

regex for string template in JsonFormatter.parse:

....
        elif isinstance(self._style, logging.StrFormatStyle):
            formatter_style_pattern = re.compile(r"\{(.+?)\}", re.IGNORECASE)
...

would require the string template to be '${asctime} ${level} ${message}'

Thomasillo avatar Jul 16 '24 14:07 Thomasillo

Hi @Thomasillo,

Just so you're aware it looks like python-json-logger is currently unmaintained, that said I am working on a maintained fork where I've opened a copy of this issue.

nhairs avatar Jul 21 '24 06:07 nhairs