Skip to content

Add traceback capability and improve time tracking info #3

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mrejman
Copy link

@mrejman mrejman commented Feb 14, 2023

Hello, thank you for this nice piece of code, please consider including the traceback capability i created to better find where the actual SQL queries are made.

apie and others added 2 commits February 21, 2019 13:37
Changes In the print_sql context manager:
  - added the first_time shared variable
  - print "time since start" for each DB query to have
        an idea about the whole script run, not only the DB queries separated

Added print_sql_to_file contextmanager:
  - save SQL commands into file instead of the log file
  - print the stacktrace for each DB query for better code line location
  - optionally filter the stacktrace with a python source file absolute path prefix
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.

2 participants