#36380: SQL is formatted for logging regardless of whether it will be logged -------------------------------------+------------------------------------- Reporter: Jacob Walls | Owner: Jacob | Walls Type: Bug | Status: assigned Component: Database layer | Version: dev (models, ORM) | Severity: Release blocker | Resolution: Keywords: debug-sql | Triage Stage: Accepted format_debug_sq | Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Comment (by Tim Graham):
So the idea is: {{{#!python if logger.isEnabledFor(logging.DEBUG): logger.debug(...) }}} It seems like it would work, but I guess I'm still concerned that SQL formatting shouldn't be part of `CursorDebugWrapper` if it has the potential to slow down request processing by 10x in any situation. For me, 3283120cca5d5eba5c3619612d0de5ad49dcf054 was too much of a hack and the formatting of `--debug-sql` output could simply be removed (i.e. revert d8f093908c504ae0dbc39d3f5231f7d7920dde37 too) unless an elegant solution is proposed. -- Ticket URL: <https://code.djangoproject.com/ticket/36380#comment:6> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/django-updates/010701970e8c856c-db3cdfcc-5baa-4f21-93e6-6b3ea3ba0c50-000000%40eu-central-1.amazonses.com.