Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use logging lazy evaluation of strings #16334

Open
fcollonval opened this issue May 16, 2024 · 0 comments
Open

Use logging lazy evaluation of strings #16334

fcollonval opened this issue May 16, 2024 · 0 comments

Comments

@fcollonval
Copy link
Member

Problem

there was some discussion about using f-strings with the Python logger in the Voila repo, with could lead to potential performance issues: voila-dashboards/voila#419 (comment)

Some more info here: https://realpython.com/python-f-strings/#lazy-evaluation-in-logging

Maybe there is a way to configure ruff to not format the strings used with the logger, if we want to follow the recommendation of not interpolating the f-strings when it's not necessary?

Originally posted by @jtpio in #16270 (comment)

Proposed Solution

Use lazy evaluation for logging by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants