I'm using the logging module to create loggers and output data. Instead of using $(asctime)s
in logging.Formatter
, is there a good way to log the timestamp relative to the creation of the logger?
Using %(relativeCreated)d
field in a conventional Formatter
format string will display the milliseconds elapsed since the logging
module was loaded. While milliseconds might not be what you want, there's no additional coding required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With