Opened 10 years ago
Closed 10 years ago
#26157 closed Cleanup/optimization (fixed)
Unify database loggers to use same log record API
| Reported by: | Markus Holtermann | Owned by: | Markus Holtermann |
|---|---|---|---|
| Component: | Migrations | Version: | dev |
| Severity: | Normal | Keywords: | logging |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
While writing https://markusholtermann.eu/2016/01/syntax-highlighting-for-djangos-sql-query-logging/ I noticed that the django.db.backends and django.db.backends.schema loggers are not using the same "higher level" API for the log records.
While the backends looger puts the query duration, sql and params into the log record, the schema logger only passes the arguments for string formatting.
Change History (6)
comment:1 by , 10 years ago
| Component: | Utilities → Migrations |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 10 years ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
follow-up: 4 comment:3 by , 10 years ago
| Needs documentation: | set |
|---|---|
| Needs tests: | set |
Release notes and tests are missing.
comment:4 by , 10 years ago
| Needs documentation: | unset |
|---|---|
| Needs tests: | unset |
| Owner: | changed from to |
PR updated: https://github.com/django/django/pull/6289
Replying to timgraham:
Release notes and tests are missing.
I don't think this change is worth a mention in the release notes, tbh.
comment:5 by , 10 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
See also #25321 which suggests to document that the schema logger doesn't include duration. Initially I thought you were proposing to add it, but I think you just want to pass
sqlandparamsin thelogger.debug()extrakwarg. Is that all?