Wednesday, June 27, 2007

Note to self: using python logging module


import logging

logging.basicConfig(level=logging.DEBUG
,format='%(asctime)s [[%(levelname)s]] %(message)s'
,datefmt='%d %b %y %H:%M'
,filename='/tmp/app.log'
,filemode='a')

logging.debug('A debug message')
logging.info('Some information')
logging.warning('A shot across the bows')