logging doc problem

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Apr 23 23:50:42 EDT 2008


En Wed, 23 Apr 2008 23:08:49 -0300, James Stroud <jstroud at mbi.ucla.edu>  
escribió:

> Am I missing something or are the docs for logging hopelessly outdated?
>
> http://docs.python.org/lib/node406.html
>
> For example, quoting the docs
>
> """
> import logging
>
> logging.debug('A debug message')
> logging.info('Some information')
> logging.warning('A shot across the bows')
> """
>
> And the result is
>
> % /usr/bin/python
> Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> py> import logging
> py>
> py> logging.debug('A debug message')
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> AttributeError: 'module' object has no attribute 'debug'

Probably you have another logging.py and you're importing it instead of  
the one in the standard library.

-- 
Gabriel Genellina




More information about the Python-list mailing list