[IMP] sql_db: Add optional traceback logging for SELECT queries#624
Open
hbto wants to merge 1 commit intoVauxoo:12.0from
Open
[IMP] sql_db: Add optional traceback logging for SELECT queries#624hbto wants to merge 1 commit intoVauxoo:12.0from
hbto wants to merge 1 commit intoVauxoo:12.0from
Conversation
…enabled via config parameter This commit adds support for logging the Python stack trace whenever a SELECT query is executed, provided the system parameter `vauxoo.traceback.extract_stack` is set to '1', 'true', or 'True'. The traceback is captured using `traceback.extract_stack()` and logged at the INFO level via `_logger.info`. This functionality is intended for debugging purposes to trace the origin of database reads. It can be particularly useful during development or troubleshooting to identify unexpected or inefficient query execution.⚠️ **WARNING**: Enabling this in production environments is discouraged, as it may generate extensive log output and potentially impact performance for frequently executed queries.
a6cc549 to
69c2386
Compare
hugho-ad
reviewed
May 9, 2025
| if _extract_stack_checked: | ||
| return _extract_stack_enabled | ||
|
|
||
| with _stack_lock: |
Collaborator
There was a problem hiding this comment.
why we need a thread? don't get it
hugho-ad
reviewed
May 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[IMP] sql_db: Add optional traceback logging for SELECT queries when enabled via config parameter
This commit adds support for logging the Python stack trace whenever a SELECT query is executed, provided the system parameter
vauxoo.traceback.extract_stackis set to '1', 'true', or 'True'.The traceback is captured using
traceback.extract_stack()and logged at the INFO level via_logger.info.This functionality is intended for debugging purposes to trace the origin of database reads. It can be particularly useful during development or troubleshooting to identify unexpected or inefficient query execution.
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr