[Feature] Cross line regex
I think that allowing regex highlighting to work across multiple lines would be a nice feature addition. For example, with the below output in a log
Ignoring exception in on_message
Traceback (most recent call last):
File "/a/python/package", line 343, in _run_event
await coro(*args, **kwargs)
File "/a/code/file", line 141, in cool_function
print(thisisanundefinedvariable)
NameError: name 'thisisanundefinedvariable' is not defined
You could use Ignoring exception[\s\S]+NameError:.+ to highlight the full traceback with a color you want to use for name errors, instead of using regex that only highlights the last line
Hi, thanks for sharing an idea. Unfortunately, all string matching in klogg is done line-by-line. Major rework is needed for multiline matching.
Merged previous similar request into this one
This is indeed a workaround. I feel that most of use-cases should be covered by adding a setting for max lines to look at during matching, and then accumulate that many strings for each match. Need to be carefull when scattering match jobs to multiple threads, but doesn't seem too hard