3 ms·
Better strategy I think is to disallow %d and others, which is never necessary in logs. Have always used either %s or %r without issue. Linters will tell you
by mixmastamyk 3y ago
Better strategy I think is to disallow %d and others, which is never necessary in logs. Have always used either %s or %r without issue.
Linters will tell you if you have the wrong number of params and you’ll get a big exception at runtime as well. Better to avoid unnecessary work, imho.
- theamk 3y ago%d is pretry useless, yes. But %.3d is great for time durations where millisecond resolutions are sufficient. Or %_d (group digits) for large numbers like filesizes.
- mixmastamyk 3y agoRereading I see your log level is the true culprit, which is postponing the errors. Not “prod” per se. This problem you mention will continue to be hidden in prod until you drop log level. Preformatting is one way to avoid but feels heavy handed. I always develop at debug level so this never happens. In fact I changed the level default in our dev environment to debug for my own convenience, unrelated to this but prevents it as a side effect.