by aequitas · 7y ago · 0 comments
log.debug("foo bar %s", foobar)
with fstrings. And you end up with part of your team enforcing f-strings because of cleaner look, the other half .format or '%' strings and the rest annoyed when their code is constantly rejected in reviews because they don't know/care which standard to use where.I get all of these arguments. I see formatting errors so often in error handling code I would much prefer they'd get caught during normal execution. I can't see trusting a heavy query to lazy evaluation...or see it coming up all that often.
I see both sides, but really think using f-strings in logging is the right compromise for Python...but I just don't see them dropping c-style formatting.
I am, however, in complete agreement that logging should adopt at least the same formatting used by .format