System Logfiles
import logging
logging.debug('Debug message')
logging.info('Information message')
logging.warning('Warning message')
logging.error('Error message')
logging.critical('Critical message')

Last updated
import logging
logging.debug('Debug message')
logging.info('Information message')
logging.warning('Warning message')
logging.error('Error message')
logging.critical('Critical message')

Last updated
logging.basicConfig(level=logging.DEBUG)import logging
from datetime import datetime
# Get the date and time and use as a filename
now = datetime.now()
file_name = '%0.4d%0.2d%0.2d-%0.2d%0.2d%0.2d' % (now.year, now.month, now.day, now.hour, now.minute, now.second)
# Set logging to that file
logging.basicConfig(filename=file_name, filemode='w', format='%(name)s - %(levelname)s - %(message)s')
logging.debug('Debug message')
logging.info('Information message')
logging.warning('Warning message')
logging.error('Error message')
logging.critical('Critical message')