This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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?
History
Date User Action Args
2022-02-04 07:23:18ariebovenbergsetrecipients: + ariebovenberg, rhettinger, vinay.sajip, eric.smith, docs@python, tinchester, erlendaasland
2022-02-04 07:23:18ariebovenbergsetmessageid: <1643959398.79.0.615987344006.issue46200@roundup.psfhosted.org>
2022-02-04 07:23:18ariebovenberglinkissue46200 messages
2022-02-04 07:23:18ariebovenbergcreate