Added handling of %f directive to print microseconds in log format options, such as log-date-format. It is impossible to do with a standard logging.Formatter because it uses time.strftime which doesn't know about milliseconds and %f. In this PR I added a custom Formatter which converts LogRecord to a datetime.datetime object and formats it with %f flag. This behaviour is enabled only if a microsecond flag is specified in a format string. Also added a few tests to check the standard and changed behavior. Closes #10991
2 lines
109 B
ReStructuredText
2 lines
109 B
ReStructuredText
Added handling of ``%f`` directive to print microseconds in log format options, such as ``log-date-format``.
|