-
Notifications
You must be signed in to change notification settings - Fork 99
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
Change log calls to use LazyFormat
and DEBUG
level
#1420
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
1 similar comment
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
ea66615
to
4a803fb
Compare
21421a9
to
bf28fa1
Compare
bf28fa1
to
229d34b
Compare
@@ -177,14 +183,15 @@ def execute( | |||
) | |||
start = time.time() | |||
request_id = SqlRequestId(f"mf_rid__{random_id()}") | |||
logger.info(AdapterBackedSqlClient._format_run_query_log_message(stmt, sql_bind_parameters)) | |||
logger.info(LazyFormat("Running query", statement=stmt, param_dict=sql_bind_parameters.param_dict)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we differentiate the log message for execute
from query
? Makes it harder to figure out where a log is coming from if the message is logged in multiple places!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
229d34b
to
70dcf64
Compare
Resolves: #1490
As per #1419, this PR updates log calls to lazily evaluate the arguments, and changes most of them to the
DEBUG
level. This way, performance in production will be improved if the log level is set toINFO
or higher.