I'm writing an app using python 3.7 and want to use only f-strings in it.
I'm using python logging module in order to log my application correctly, and I want to use a specific format but the documentation (and the web) only example how to change the format using %-strings. I was wondering whether there is an option to set the logger format using f-strings
LOG_FORAMT = ('%(levelname)s -10s %(asctime)s -10s %(message)s') # Known example
f-LOG_FORMAT = (f'{logger.levelname} -10s') # Something like that?
logger.error(f"bad var: {var}")
. So, in practice, you dont have to deal with weird format strings past your log setup. – Aldrinlogger.error() / logger.info() / etc...
), I was just wondering whether there is an option to use f-string format in the log formatter.. – Kweilin