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

Change log calls to use LazyFormat and DEBUG level #1420

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Sep 24, 2024

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 to INFO or higher.

@cla-bot cla-bot bot added the cla:yes label Sep 24, 2024
Copy link

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
Copy link

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.

@plypaul plypaul force-pushed the p--short-term-perf--02 branch from ea66615 to 4a803fb Compare September 24, 2024 02:37
@plypaul plypaul force-pushed the p--short-term-perf--03 branch from 21421a9 to bf28fa1 Compare September 24, 2024 02:37
Base automatically changed from p--short-term-perf--02 to main September 24, 2024 02:42
@plypaul plypaul force-pushed the p--short-term-perf--03 branch from bf28fa1 to 229d34b Compare September 24, 2024 02:43
@plypaul plypaul marked this pull request as ready for review September 24, 2024 02:45
@@ -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))
Copy link
Contributor

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@plypaul plypaul force-pushed the p--short-term-perf--03 branch from 229d34b to 70dcf64 Compare September 24, 2024 17:57
@plypaul plypaul merged commit 2e7a0bf into main Sep 24, 2024
15 checks passed
@plypaul plypaul deleted the p--short-term-perf--03 branch September 24, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SL-2831] Switch target info logs to debug
2 participants