rainbow_logging_handler icon indicating copy to clipboard operation
rainbow_logging_handler copied to clipboard

More flexible column detection in complex format strings

Open staticglobal opened this issue 9 years ago • 3 comments

python printf-style format strings, such as those used by the logging formatter, have provisions for many advanced field conversions such as field widths, padding characters, etc. For example, you can force the "msecs" to always be a zero-padded 3-digit field by specifying "%(msecs)03d". However, modifiers such as these breaks rainbow_logging_handler which is looking for a strict string match for "%(msecs)d".

This change enhances rainbow_logging_handler to detect and cope with (almost) any field conversion modifiers and still apply the appropriate colors.

staticglobal avatar May 24 '16 17:05 staticglobal

Also adds a new dependency on the "re" standard library

staticglobal avatar May 24 '16 17:05 staticglobal

Hi!

I am taking over the library maintenance. Can you please add an automated test case to stress out this functonality and it's good to merge.

miohtama avatar Aug 17 '16 01:08 miohtama

+1 - for this feature. The current date stamp format doesn't support the ms precision we need.

jclosure avatar Aug 23 '17 17:08 jclosure