Message412496
| Author |
ariebovenberg |
| Recipients |
ariebovenberg, docs@python, eric.smith, erlendaasland, rhettinger, tinchester, vinay.sajip |
| Date |
2022-02-04.07:23:18 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1643959398.79.0.615987344006.issue46200@roundup.psfhosted.org> |
| In-reply-to |
|
| Content |
@rhettinger @tinchester I definitely see now that f-strings should have a place in logging.
But do you agree that f-strings don't mix 100% safely with the current logger API?
What are your thoughts on a safer set of logger functions (see my comments above, https://bugs.python.org/issue46200#msg409505)
Just throwing an additional alternative out there: instead of the @overload approach, one could have 2 logger function families:
debugs(s: str) # s-prefix indicates simply logging a string (no formatting done by logger!)
debugf(s: LiteralStr, *args, **kwargs) # f prefix indicates logger does the formatting. (no formatting done by user!)
@vinay.sajip what are your thoughts on the discussion above? |
|