Reputation: 71
The logging module offers automatic display off information next to the logging message:
logging.basicConfig(format='%(levelname)s {%(filename)s:%(lineno)s} in %(funcName)s: %(message)s', level=logging.DEBUG)
I want to include the seconds from start of the runtime of the script. logging module offers msecs
but how can i include the seconds since start inside this format string?
Upvotes: 1
Views: 127
Reputation: 363435
In the documented logrecord attributes:
relativeCreated %(relativeCreated)d
Time in milliseconds when the LogRecord was created, relative to
the time the logging module was loaded.
Upvotes: 1