[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bothans-dev] Howto: Using the logging framework

From: mrasschaert
Subject: [bothans-dev] Howto: Using the logging framework
Date: Tue, 8 Apr 2003 16:59:58 +0200

After a few tests I found what i think is good practice concerning the 
logging framework mentionned in another thread.

For each file (module or program) you want to use the logging framework 
you should insert something like this near the beginning of the file : 

import logging
log = logging.getLogger("SensibleName")

logging.DEBUG could be logging.INFO, logging.WARN, logging.ERROR or 

in the file you use the methods log.debug(msg) , ,etc... to log 

You can use format strings like

log.debug("Hello my name is %s","Michel") to make messages more specific.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]