Back to index

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

List of all members.

Public Member Functions

def __init__
def munge_message
def log
def log_exc
def __call__

Public Attributes

 target
 closeable

Static Public Attributes

int closeable = 0
 fp = None

Private Member Functions

def _open
def _close

Detailed Description

Definition at line 33 of file debug.py.


Constructor & Destructor Documentation

def Archetypes.debug.Log.__init__ (   self,
  target = sys.stderr 
)

Reimplemented in Archetypes.debug.NullLog.

Definition at line 37 of file debug.py.

00037 
00038     def __init__(self, target=sys.stderr):
00039         self.target = target
00040         self._open()

Here is the caller graph for this function:


Member Function Documentation

def Archetypes.debug.Log.__call__ (   self,
  msg 
)

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.Log._close (   self) [private]

Definition at line 54 of file debug.py.

00054 
00055     def _close(self):
00056         if self.closeable:
00057             self.fp.close()

Here is the caller graph for this function:

def Archetypes.debug.Log._open (   self) [private]

Definition at line 41 of file debug.py.

00041 
00042     def _open(self):
00043         if self.fp is not None and not self.fp.closed:
00044             return self.fp
00045 
00046         if type(self.target) is StringType:
00047             fp = open(self.target, "a+")
00048             self.closeable = 1
00049         else:
00050             fp = self.target
00051 
00052         self.fp = SafeFileWrapper(fp)
00053 

Here is the caller graph for this function:

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

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 
)

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.Log.munge_message (   self,
  msg,
  kwargs 
)
Override this to messge with the message for subclasses

Reimplemented in Archetypes.debug.ClassLog.

Definition at line 58 of file debug.py.

00058 
00059     def munge_message(self, msg, **kwargs):
00060         """Override this to messge with the message for subclasses"""
00061         return msg

Here is the caller graph for this function:


Member Data Documentation

Definition at line 34 of file debug.py.

Definition at line 47 of file debug.py.

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

Definition at line 35 of file debug.py.

Definition at line 38 of file debug.py.


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