Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
Archetypes.debug.ZLogger Class Reference
Inheritance diagram for Archetypes.debug.ZLogger:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.debug.ZLogger:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def log
def log_exc
def generateFrames
def munge_message
def __call__

Public Attributes

 closeable
 target

Static Public Attributes

 last_frame_msg = None
int closeable = 0
 fp = None

Detailed Description

Definition at line 144 of file debug.py.


Member Function Documentation

def Archetypes.debug.Log.__call__ (   self,
  msg 
) [inherited]

Definition at line 74 of file debug.py.

00074 
00075     def __call__(self, msg):
00076         self.log(msg)
00077 

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.debug.ClassLog.generateFrames (   self,
  start = None,
  end = None 
) [inherited]

Reimplemented in Archetypes.debug.ZPTLogger.

Definition at line 96 of file debug.py.

00096 
00097     def generateFrames(self, start=None, end=None):
00098         try: 
00099             return inspect.stack()[start:end]
00100         except IndexError:
00101             # NOTE: this is required for OS-X Tiger somehow
00102             return []
00103         except TypeError:
00104             # NOTE: this is required for psyco compatibility
00105             #       since inspect.stack is broken after psyco is imported
00106             return []

Here is the caller graph for this function:

def Archetypes.debug.ZLogger.log (   self,
  msg,
  args,
  kwargs 
)

Reimplemented from Archetypes.debug.Log.

Definition at line 145 of file debug.py.

00145 
00146     def log(self, msg, *args, **kwargs):
00147         level = kwargs.get('level', logging.INFO)
00148         msg = "%s\n" % (self.munge_message(msg, **kwargs))
00149         for arg in args:
00150             msg += "%s\n" % pprint.pformat(arg)
00151         logger.log(level, msg)

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.debug.ZLogger.log_exc (   self,
  msg = None,
  args,
  kwargs 
)

Reimplemented from Archetypes.debug.Log.

Definition at line 152 of file debug.py.

00152 
00153     def log_exc(self, msg=None, *args, **kwargs):
00154         logger.exception(msg)

def Archetypes.debug.ClassLog.munge_message (   self,
  msg,
  kwargs 
) [inherited]
Override this to messge with the message for subclasses

Reimplemented from Archetypes.debug.Log.

Definition at line 107 of file debug.py.

00107 
00108     def munge_message(self, msg, **kwargs):
00109         deep = kwargs.get("deep", 1)
00110         collapse = kwargs.get("collapse", 1)
00111         offset   = kwargs.get("offset", 0) + 3
00112 
00113         frame = ''
00114         try:
00115             frames = self.generateFrames(offset, offset+deep)
00116             res = []
00117             for f in frames:
00118                 res.insert(0, self._process_frame(f))
00119             frame = ''.join(res)
00120         finally:
00121             try:
00122                 del frames
00123             except:
00124                 pass
00125 
00126         if collapse == 1:
00127             if frame == self.last_frame_msg:
00128                 frame = ''
00129             else:
00130                 self.last_frame_msg = frame
00131 
00132         msg = "%s%s" %(frame, msg)
00133         return msg
00134 

Here is the call graph for this function:


Member Data Documentation

int Archetypes.debug.Log.closeable = 0 [static, inherited]

Definition at line 34 of file debug.py.

Definition at line 47 of file debug.py.

Archetypes.debug.Log.fp = None [static, inherited]

Definition at line 35 of file debug.py.

Archetypes.debug.ClassLog.last_frame_msg = None [static, inherited]

Definition at line 84 of file debug.py.

Definition at line 38 of file debug.py.


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