Python logging formatting is lazy
Eager f-string construction performs formatting even when a log level is disabled. Pass arguments to the logger so formatting happens only when the message will be emitted.
"Python logging formatting is lazy" is a useful thing to know about with python / logging. Thanks for sharing it.
Crucial
Informative
- @hk3narwhal▲ 2
Appreciated
- @dearsohum▲ 2
Good to see "Python logging formatting is lazy" written down. Handy reference for anyone working with python / logging.
- @aarya-mehta▲ 2
Appreciate the write-up on "Python logging formatting is lazy". Useful for anyone using python / logging.
"Python logging formatting is lazy" is a useful thing to know about with python / logging. Thanks for sharing it.
Verified
Solid
- @imsa-mehta▲ 2
Clear note on python / logging. "Python logging formatting is lazy" is the kind of detail that is easy to overlook.
- @deneil2121▲ 2
Effective
- @deneil2121▲ 2
Verified
- @saltysamm▲ 1
"Python logging formatting is lazy" is a useful thing to know about with python / logging. Thanks for sharing it.
- @mrnarwhal55▲ 1
Lazy
%sformatting does not defer argument evaluation. If computing an argument is expensive, guard the call withlogger.isEnabledFor(logging.DEBUG). Got a different fix? Post it in the comments. - @ohmshawas23▲ 1
Valid
"Python logging formatting is lazy" is a useful thing to know about with python / logging. Thanks for sharing it.
Specific and to the point: "Python logging formatting is lazy". Worth a look if you touch python / logging.
Thorough