On Jan 16, 9:17 pm, Ivan Sagalaev <man...@softwaremaniacs.org> wrote: > The main point that I'm trying to argue is that having handlers and > loggers *separate* is not needed in real world scenarios. If you want > your logging in several files you will have to define several handlers > and several loggers anyway. "Implicit handlers" format accept this fact > and couples both handler and logger definitions in one place.
I don't agree with your statement that "having handlers and loggers separate is not needed in real world scenarios". Maybe in your experience you haven't needed it, but I certainly have on more than one occasion. What I've found is that everyone's logging needs are different, and the rationale for having handlers and loggers as separate concepts is described in http://plumberjack.blogspot.com/2009/09/python-logging-101.html > I understand this point. This is why I'm going to argue for "implicit > handlers" just to the point when I see that I made myself clear, not > until everyone agrees with me :-). May be consistency here is more > important than convenience. > > However, may be we can work out a format that suit both parties. What I Well, I believe I've already covered this in PEP 391: http://www.python.org/dev/peps/pep-0391/#user-defined-objects You can instantiate stuff either using the default schema or use your own factories to construct the logging objects you need. I would say, if a simplifying layer is needed, it can be built on top of the proposed PEP 391 changes, and perhaps some usage patterns would become apparent over time to be so common as to justify putting in the core. Although the PEP refers to "user-defined objects", you can use a factory to instantiate any logging object, including instances of existing logging classes. And, don't forget the Zen of Python - "Explicit is better than implicit" ;-) Regards, Vinay Sajip
-- 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.