mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Add python 2.3 logging to the tree. Only install if not present. Convert xend to use logging.
14 lines
310 B
Python
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")
|
|
|