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

fix the most egregious issue with the use of python logging #138

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

ekalosak
Copy link
Contributor

@ekalosak ekalosak commented Sep 16, 2023

From the Python 3.11 docs, emphasis added:
"""
debug(msg, *args, **kwargs)

Logs a message with level DEBUG on this logger. The msg is the message format string, and the args are the arguments which are merged into msg using the string formatting operator. (Note that this means that you can use keywords in the format string, together with a single dictionary argument.) No % formatting operation is performed on msg when no args are supplied.
"""

The simplest reproducible error case is: python -c 'import logging; logging.warning("asdf", "qwer");'
The expected result is a stack trace.

To fix: logger.warning("asdf %s", "qwer");

Please note that the firebase-functions-python codebase has a tremendous number of instances of this logging usage error. I'm only fixing the one that I encounter most frequently here, but it might be useful to perform a systematic review of the logging usage throughout the package.

@taeold taeold merged commit 51362fb into firebase:main Sep 25, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants