We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The book includes a "TIP" box saying that:
As of Python 3.9, f-strings don’t work with loggers.
I don't believe this info box is accurate, nor was I able to find a source for that. I also did a (very basic) test to check:
# tested on both 3.9.10 and 3.10.0 import logging l = logging.getLogger() l.addHandler(logging.StreamHandler()) a = 3 l.error(f'a is {a}') # prints "a is 3"
I think either:
David Brownman
The text was updated successfully, but these errors were encountered:
The good example could also be improved:
logger.debug('Only %d pints of ice cream left.' % pints_remaining)
This uses interpolation of the log message, but it's better practise to allow the logging module to do that interpolation for you.
logger.debug('Only %d pints of ice cream left.', pints_remaining)
There is a great flake8 plugin to check this automatically: https://github.com/globality-corp/flake8-logging-format
Sorry, something went wrong.
No branches or pull requests
Location within the Book
Description
The book includes a "TIP" box saying that:
I don't believe this info box is accurate, nor was I able to find a source for that. I also did a (very basic) test to check:
Possible Solutions
I think either:
Your full name so we can provide accurate credit within the book
David Brownman
The text was updated successfully, but these errors were encountered: