On Mon, May 25, 2009 at 3:19 PM, tom <thomas.st...@gmail.com> wrote:

>
> Hi,
>
> I want to add some logging for debugging reasons in some views and
> therefore I think about to add something like this in my views:
> if settings.DEBUG:
>    logger.debug("some text")
>
> Would you recommend that? Is that good design? To be honest, I am
> asking not about performance, just about how you would do something
> like that.
>
> many thanks, tom
> >
>
I'd just use the various logging.debug, .info, .critical, etc. and then use
logging.set_level (or whatever it's called) conditionally on settings.DEBUG,
that way you only have the test in one place.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

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

Reply via email to