logging.LogRecord asctime aattribute - easily override somehow?

Peter Otten __peter__ at web.de
Wed Mar 29 12:39:59 EDT 2017

Skip Montanaro wrote:

> Short of going into some Formatter creation exercise (which seems like
> overkill to me, and somewhat obscure), is there some way to easily
> change the format of the logging.LogRecord's asctime attribute?
> Thx,
> Skip


>>> import logging
>>> logging.basicConfig(format="%(asctime)s" + logging.BASIC_FORMAT, 
>>> logging.warn("foo")


More information about the Python-list mailing list