Hi Vinay,

Thanks for taking the time to review and provide feedback on this.
Your explanation of how the logging module works and how it can be
used was really helpful.

> (a) Setting NOTSET on the root logger will cause absolutely everything
> to go through the logging system - this could be unnecessary overhead as
> well as being too much information.

My reason for doing this was indeed to capture as much information as
possible and then give the user the ability to filter the messages
afterwards. I guess if there are lots of things logged in a single
request then this could get unmanageable.

> (b) You don't need to set NOTSET on the handler - that's the default
> setting.

This was left in from me experimenting and has now been removed.

> (c) You don't need to set a do-nothing formatter on the handler, as
> you are not using the formatting capability anyway.

I had (unnecessarily) been using that formatter to format the
timestamps for the log records, but have now removed this and tidied
it up to use strftime.

> (d) It's probably better to put logging configuration in settings.py;

Moving the level configuration into settings.py is probably a good
idea, but I think it would be good to find a balance between ease of
getting the logging facility up and running and level of control for
more advanced users.

Having the handler registered with the root logger by default means
things should just work with minimal configuration. If someone didn't
want this configuration, they could always use removeHandler to
unregister it from the root logger.

What do people think?

> Also, you could consider using thread locals to hold the list of
> records, as this usage seems what they were designed for.

I agree that thread locals would probably be ideal, but it looks like
threading.local was only introduced in Python 2.4. To stay aligned
with Django, it should really be 2.3 compatible.

Cheers,

Fraser

P.S. I have also added handling of HTTP redirects this evening as
requested by "pmdhazy" via the Google Code issue list.


--~--~---------~--~----~------------~-------~--~----~
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