On Mon, 2008-04-21 at 01:50 -0700, ludvig.ericson wrote:
> On Apr 21, 12:40 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
> wrote:
> > -1 here too, for exactly the same reason. Add to that the inevitable
> > Murphyism that the one time you specify N=10 will be the time that the
> > 11th oldest query will be the one causing the problem.
> 
> I agree, though my suggestion is to not log SQL at all unless
> explicitly stated, i.e., an SQL_DEBUG setting, that is either True or
> False. As Russell says, when you actually want the SQL, whatever you
> set as "SQL buffer" will always be at least N-1 too little.
> 
> So, -0, but suggest a SQL_DEBUG setting instead.

I've been sort of leaning towards that sort of solution, too (with
SQL_DEBUG being off by default). I'm not entirely in love with the
justification that capturing the SQL queries is a just punishment/check
for leaving DEBUG=True in production, since it's not an entirely obvious
crippling feature to detect. But tweaking the number of queries is
possibly a bit too fine-grained; either you want the queries or you
don't.

We're close to introducing a signal fired on each SQL request that will
only be enabled for tests, so that tests can check queries without
needing to do connection.queries gymnastics, so that won't be affected.

Malcolm

-- 
Depression is merely anger without enthusiasm. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to