Back to index

plone3  3.1.7
Functions | Variables
CMFFormController.utils Namespace Reference

Functions

def log
def exceptionString
def logException

Variables

tuple logger = logging.getLogger('CMFFormController')

Function Documentation

Definition at line 13 of file utils.py.

00013 
00014 def exceptionString():
00015     s = sys.exc_info()[:2]  # don't assign the traceback to s
00016                             # (otherwise will generate a circular reference)
00017     if s[0] == None:
00018         return None
00019     if isinstance(s[0], basestring):
00020         return s[0]
00021     return str(s[1])
00022 
00023 # provide a way of dumping an exception to the log even if we
# catch it and otherwise ignore it

Here is the caller graph for this function:

def CMFFormController.utils.log (   summary = '',
  text = '',
  log_level = logging.INFO 
)

Definition at line 7 of file utils.py.

00007 
00008 def log(summary='', text='', log_level=logging.INFO):
00009     logger.log(log_level, '%s \n%s' % (summary, text))
00010 
00011 # Enable scripts to get the string value of an exception
00012 # even if the thrown exception is a string and not a
# subclass of Exception.

Here is the caller graph for this function:

Dump an exception to the log

Definition at line 24 of file utils.py.

00024 
00025 def logException():
00026     """Dump an exception to the log"""
00027     log(summary=str(exceptionString()),
00028         text='\n'.join(traceback.format_exception(*sys.exc_info())),
00029         log_level=logging.WARNING)

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

tuple CMFFormController.utils.logger = logging.getLogger('CMFFormController')

Definition at line 5 of file utils.py.