Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
CMFCore.tests.base.testcase.LogInterceptor Class Reference

List of all members.

Public Member Functions

def filter

Public Attributes

 level
 installed

Static Public Attributes

 logged = None
tuple installed = ()
int level = 0

Private Member Functions

def _catch_log_errors
def _ignore_log_errors

Detailed Description

Definition at line 24 of file testcase.py.


Member Function Documentation

def CMFCore.tests.base.testcase.LogInterceptor._catch_log_errors (   self,
  ignored_level = logging.WARNING,
  subsystem = '' 
) [private]

Definition at line 30 of file testcase.py.

00030 
00031     def _catch_log_errors(self, ignored_level=logging.WARNING, subsystem=''):
00032 
00033         if subsystem in self.installed:
00034             raise ValueError, 'Already installed filter!'
00035 
00036         root_logger = logging.getLogger(subsystem)
00037         self.installed += (subsystem,)
00038         self.level = ignored_level
00039         root_logger.addFilter(self)

Here is the caller graph for this function:

def CMFCore.tests.base.testcase.LogInterceptor._ignore_log_errors (   self,
  subsystem = '' 
) [private]

Definition at line 48 of file testcase.py.

00048 
00049     def _ignore_log_errors(self, subsystem=''):
00050 
00051         if subsystem not in self.installed:
00052             return
00053 
00054         root_logger = logging.getLogger(subsystem)
00055         root_logger.removeFilter(self)
00056         self.installed = tuple([s for s in self.installed if s != subsystem])
00057 

Here is the caller graph for this function:

Definition at line 40 of file testcase.py.

00040 
00041     def filter(self, record):
00042         if record.levelno > self.level:
00043             return True
00044         if self.logged is None:
00045             self.logged = []
00046         self.logged.append(record)
00047         return False


Member Data Documentation

Definition at line 27 of file testcase.py.

Definition at line 55 of file testcase.py.

Definition at line 28 of file testcase.py.

Definition at line 37 of file testcase.py.

Definition at line 26 of file testcase.py.


The documentation for this class was generated from the following file: