python - Logging in custom time format -


the logging module offers automatic display off information next logging message:

logging.basicconfig(format='%(levelname)s {%(filename)s:%(lineno)s} in %(funcname)s: %(message)s', level=logging.debug) 

i want include seconds start of runtime of script. logging module offers msecs how can include seconds since start inside format string?

in documented logrecord attributes:

relativecreated %(relativecreated)d   time in milliseconds when logrecord created, relative  time logging module loaded. 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -