Are there any tools/modules/libraries in python that allow for file comparison? It should allow for regular expressions that can ignore items that shouldn't be compared such as log timestamps, file/line number, etc. but still compare the log level and message part of the log. It will provide for comparing canonical log lines in unit testing.
I have found some related posts such as this but they use unittest framework and also only work on line by line comparisons which doesn't meet my intended use case.
Note: Canonical implies official, so these lines it will be comparing shouldn't change from implementation to implementation. A change in canonical logs indicates a change in behavior. Here is an article on canonical logs.