On 28/05/2010 16:48, Russell Keith-Magee wrote:
The second commit will be the addition of actual logging. The
intention here is to be initially conservative; two immediate targets
would be to replace calls to mail_admins() with logging calls, and
replacing debug messages in management commands with their logging
equivalent.
At this point, it largely becomes a political problem -- we don't want
Django's core to get bogged down in trivial logging calls, so we need
to develop our policy on when we add a logging statement to trunk, and
at what trace level, and so on.
How about not adding any logging statements to trunk directly at all?
Static logging is in some ways bad:
* There's no central control over the formatting of log statements
* They have to be sprinkled all over the place (or in a lot of places,
at least) rather than the logging aspect of the application being more
centrally defined, which makes it hard to ensure they're consistently
where they ought to be
One way round this is to use an aspect-oriented approach, which is nice
and easy in Python - e.g. http://www.hackersinshape.net/archives/67 -
this would allow us to drop decorators onto functions we want logging
around, and possibly even do so dynamically for maximum flexibility and
ease of maintenance.
Of course, the end result would still be calls to the standard logging
framework, so this suggestion is entirely orthogonal to the rest of the
proposal.
Just my €0.02, anyway. If the consensus is that there's some mileage in
the above I might be willing to try and come up with some code, though
my time is limited. Equally, I'm sure some of you may have been thinking
along these lines already :-)
Cheers,
David
--
You received this message because you are subscribed to the Google Groups "Django
developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.