pytest
4da90267 - Handle microseconds with custom logging.Formatter (#11047)

Commit
2 years ago
Handle microseconds with custom logging.Formatter (#11047) 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
Author
Parents
Loading