Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 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 Respostas
+ 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