Hi,
I'd like to open a discussion on bug
#9363 and
#22320 which are about improving query logging to capture call stacks. The 9363 was marked wontfix, but I don't understand the reason given.
The use case is simple: when using assertNumQueries in a testcase, it would be very useful to get the stack trace for where the queries were executed in the output, as well as the queries.
The original bug was accepted as a good idea by Claude Peroz but required a fix to
#22320 first. This has now been fixed, removing the concern about memory usage.
The wontfix reason given by Aymeric was "use Django Debug Toolbar" and "the code looks bad". DDT is a great tool, but doesn't solve this use case, and the code is a three-line patch (and 5 lines of test code)
Can this be reconsidered for re-opening? I'm happy to improve the patch if that's needed.
Cheers,
Malcolm