Files
xen/tools/python/logging/logging-0.4.9.2/test/myapp.py
T
mjw@wray-m-3.hpl.hp.com 5b14d2aca3 bitkeeper revision 1.1108.1.8 (40ffc44fV2fs0W-8bRw5B0XcBdmAsw)
Add python 2.3 logging to the tree. Only install
if not present. Convert xend to use logging.
2004-07-22 13:42:39 +00:00

14 lines
310 B
Python

import logging, mymodule
logging.basicConfig()
log = logging.getLogger("MyApp")
log.setLevel(logging.DEBUG) #set verbosity to show all messages of severity >= DEBUG
log.info("Starting my app")
try:
mymodule.doIt()
except Exception, e:
log.exception("There was a problem.")
log.info("Ending my app")