logging doc problem

J

James Stroud

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'


More importantly, do any good docs for logging exist, or is it touch and go?

James
 
G

Gabriel Genellina

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,170
Latest member
Andrew1609
Top