Back to index

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

List of all members.

Public Member Functions

def generateFrames
def munge_message
def log
def log_exc
def __call__

Public Attributes

 closeable
 target

Static Public Attributes

 last_frame_msg = None
int closeable = 0
 fp = None

Detailed Description

Definition at line 135 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.ZPTLogger.generateFrames (   self,
  start = None,
  end = None 
)

Reimplemented from Archetypes.debug.ClassLog.

Definition at line 136 of file debug.py.

00136 
00137     def generateFrames(self, start=None, end=None):
00138         frames = inspect.stack()
00139         for f in frames:
00140             # We want to look for either <script...
00141             # or <template...
00142             print f
00143         return frames

def Archetypes.debug.Log.log (   self,
  msg,
  args,
  kwargs 
) [inherited]

Reimplemented in Archetypes.debug.ZLogger.

Definition at line 62 of file debug.py.

00062 
00063     def log(self, msg, *args, **kwargs):
00064         self._open()
00065         self.fp.write("%s\n" % (self.munge_message(msg, **kwargs)))
00066         for arg in args:
00067             self.fp.write("%s\n" % pprint.pformat(arg))
00068         self._close()

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.debug.Log.log_exc (   self,
  msg = None,
  args,
  kwargs 
) [inherited]

Reimplemented in Archetypes.debug.ZLogger.

Definition at line 69 of file debug.py.

00069 
00070     def log_exc(self, msg=None, *args, **kwargs):
00071         self.log(''.join(traceback.format_exception(*sys.exc_info())), offset=1)
00072         if msg: self.log(msg, collapse=0, deep=0, *args, **kwargs)
00073 

Here is the call graph for this function:

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: