On Tue, Sep 29, 2009 at 9:00 PM, Waylan Limberg <way...@gmail.com> wrote: > > On Tue, Sep 29, 2009 at 4:36 AM, Vinay Sajip <vinay_sa...@yahoo.co.uk> wrote: >> >> >> >> On Sep 17, 9:25 am, Simon Willison <si...@simonwillison.net> wrote: >>> Problems and challenges >>> ======================= >>> >>> 1. The Python logging module isn't very nicely designed - its Java >>> heritage shines through, and things like logging.basicConfig behave in >>> unintuitive ways (if you call basicConfig twice the second call fails >>> silently but has no effect). This is why I suggest wrapping it in our >>> own higher level interface. >> >> Simon, I'm the author of Python's logging package. Sorry for the delay >> in replying, I've been away from this list awhile. I think the "Java >> heritage shines through" is just FUD. basicConfig's behaviour is fully >> documented here: >> >> http://docs.python.org/library/logging.html#logging.basicConfig >> >> Including the fact that it sometimes (by design) has no effect. >> >> There are a lot of people for whom logging just means writing to a >> file, and that's why they have difficulty understanding why logging is >> designed as it is. I would suggest you take a quick look at >> >> http://plumberjack.blogspot.com/2009/09/python-logging-101.html >> >> and then tell me why you think Python logging isn't well designed for >> its purpose. You can do basic logging with two lines of setup (one >> line if you ignore the import): >> >> import logging >> logging.basicConfig(level=logging.DEBUG,filename='/path/to/my/log', >> format='%(asctime)s %(message)s') >> >> and then >> >> logging.getLogger(__name__).debug("Just checking this works") >> >> Not too sure where the Java heritage is there, or where the hard part >> is. >> > > The hard part is that basicConfig only works like that back to Python > 2.4 yet Django supports 2.3. When I added logging to Python-Markdown, > this was the hardest part. Figuring out how to configure logging so > that it works in 2.3 as well. The documentation is not exactly helpful > in that regard. ... > Of course, it is possible that I'm missing something obvious.
As luck would have it, you are :-) Django 1.2 will drop formal support for Python 2.3. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ 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 django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---