problems with logging module

Alia Khouri alia_khouri at yahoo.com
Tue Jul 31 07:36:00 EDT 2007


> You are not going beyond basicConfig - I'd write the above as:

Intentionally didn't go beyond basicConfig. The problem is global
level configuration vs. easy local (in function or in class)
configuration.


> logging.basicConfig(...)
>
> def __init__(self, x):
>      self.x = x
>      self.log = logging.getLogger("a.nice.name")
>
> If you *do* need more than a handler, or different formatters for
> different loggers, then you must write your own setup anyway; perhaps
> using logging.config files, or perhaps writing your own code. I can't
> think of a simple and generic approach (beyond what basicConfig provides)
> but if you can write something that other people find useful, feel free to
> submit a patch.

Why not indeed... let's see what happens.

AK




More information about the Python-list mailing list