473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

logging doc problem

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.
pyimport logging
py>
pylogging.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
Jun 27 '08 #1
1 1109
En Wed, 23 Apr 2008 23:08:49 -0300, James Stroud <js*****@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.
pyimport logging
py>
pylogging.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

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Thomas Schulz | last post by:
Hello, I'm using the logging package from python 2.3 on RH linux. Everything in the test program below works fine if we just use the log configuration with 'logging.basicConfig'. For the...
1
by: j vickroy | last post by:
My system: MSW XP professional Python 2.3.3 logging package: 0.4.9.2 My problem: The log_test3.py script, provided with the logging package distribution, generates an unexpected message: No...
0
by: Neil Benn | last post by:
Hello, I'm running a test and having issues with logging, if I call logging.shutdown() and then want to start the logging going again then I get a problem as if I call shutdown, I can't get the...
10
by: Thomas Heller | last post by:
I'm about to add some logging calls to a library I have. How can I prevent that the script that uses the library prints 'No handlers could be found for logger "comtypes.client"' when the script...
6
by: Burkhard Schultheis | last post by:
As I wrote last week, we have a problem with a DB2 V8 on Linux. Here is what is in db2diag.log during online backup: Starting a full database backup. 2004-04-01-02.33.54.760164 ...
6
by: Kevin Jackson | last post by:
Let's say we log exceptions to the windows application event log using the Exception Management Application Block. Is there a pattern that can be used so the exception is logged only once and not...
7
by: Jed Parsons | last post by:
Hi, I'm using the logging module for the first time. I'm using it from within Zope Extensions. My problem is that, for every event logged, the logger is producing multiple identical entries...
5
by: Ritesh Raj Sarraf | last post by:
import os, sys, logging logger = logging.getLogger("my_app") conerr = logging.StreamHandler(sys.stderr) conerr.setLevel(logging.DEBUG) conerr_formatter = logging.Formatter('%(levelname)s...
0
by: RobinS | last post by:
I have sent a message to the apache listserver, but thought I would ask here, too, just in case anyone has seen this problem. I am using log4net to do logging in my .Net 2.0 application. I am...
1
by: ludvig.ericson | last post by:
Quote from the docs: FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s" logging.basicConfig(format=FORMAT) d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.