+ 1
Does the logging module support f-string?
format strings in python are really awesome. is it possible to use them in the ''format" keyword argument of the "logging.basicConfig" method? maybe like import logging logging.basicConfig(format=f'...')
2 Antworten
+ 3
I've never used it but according to the documentation it doesn't look like it... but it wouldn't hurt to try anyway 🙂
https://docs.python.org/3/library/logging.html#logging.basicConfig
"If format is specified, use this style for the format string. One of '%', '{' or '#x27; for printf-style, str.format() or string.Template respectively. Defaults to '%'."
+ 1
thanks, I tried it out but got a traceback