I would like to add the number of seconds my program is up to my logging output.
I've found relativeCreated here but it will give me the milliseconds, e.g. this:
logging.basicConfig(format='{relativeCreated:8.0f}ms {levelname:s} {message:s}', style="{")
Results in
4081ms INFO my message
6012ms INFO another message
But as I expect the running times to be in the hours, I would prefer.
4s INFO my message
6s INFO another message
I tried
logging.basicConfig(format='{relativeCreated / 1000:4.0f}s {levelname:s} {message:s}', style="{")
but this results in
KeyError: 'relativeCreated / 1000'