| Home | Trees | Indices | Help |
|
|---|
|
|
descriptor that returns a logger named after the class or subclass
Simply do something like:>>> import logging >>> logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) >>> class Foo(object): ... logger=AutoLogger()
>>> class Bar(Foo): ... pass
>>> f=Foo() >>> f.logger.error("I am foo") ERROR:Foo:I am foo >>> b=Bar() >>> b.logger.error("I am bar") ERROR:Bar:I am bar >>> Foo.logger.error("This logs from class Foo") ERROR:Foo:This logs from class Foo >>> Bar.logger.error("And this is from class Bar") ERROR:Bar:And this is from class Bar
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Mon Mar 10 05:37:14 2008 | http://epydoc.sourceforge.net |