Back to index

plone3  3.1.7
log.py
Go to the documentation of this file.
00001 """
00002 This module resolves an import order dependency.
00003 Don't import from here, import from utils.
00004 """
00005 
00006 import logging
00007 
00008 logger = logging.getLogger('Plone')
00009 
00010 # generic log method
00011 def log(message, summary='', severity=logging.INFO):
00012     logger.log(severity, '%s \n%s', summary, message)
00013 
00014 # log message + exception info
00015 def log_exc(message='', summary='', severity=logging.ERROR):
00016     logger.log(severity, '%s \n%s', summary, message, exc_info=True)
00017 
00018 # deprecration warning
00019 def log_deprecated(message, summary='Deprecation Warning',
00020                    severity=logging.WARNING):
00021     logger.log(severity, '%s \n%s', summary, message)