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

feat(debug): add SQL query debugging option #313

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Conversation

WilsonNet
Copy link
Collaborator

@WilsonNet WilsonNet commented Sep 17, 2024

Added two environment variables DEBUG and DEBUG_SQL_QUERY for
debugging. The DEBUG_SQL_QUERY variable is separated to control
verbose SQL query logging. Updated settings to handle these variables
and configure logging accordingly.

Closes #268

image

backend/README.md Outdated Show resolved Hide resolved
DEBUG_SQL_QUERY = False
# This is a dedicated debug env for SQL queries, it is not combine
# with debug because it outputs too much data,
ENV_DEBUG_SQL_QUERY = get_json_env_var("DEBUG_SQL_QUERY", False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about enabling ENV_DEBUG_SQL_QUERY only if DEBUG is also true?

Comment on lines 52 to 53
# This is a dedicated debug env for SQL queries, it is not combine
# with debug because it outputs too much data,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the comments

Added two environment variables `DEBUG` and `DEBUG_SQL_QUERY` for
debugging. The `DEBUG_SQL_QUERY` variable is separated to control
verbose SQL query logging. Updated settings to handle these variables
and configure logging accordingly.
@WilsonNet WilsonNet merged commit a584ded into main Sep 17, 2024
4 checks passed
@WilsonNet WilsonNet deleted the feat/debug-query branch October 24, 2024 16:37
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.

Configure Django settings to enable query debug with QUERY_DEBUG env
4 participants