HWRF  trunk@4391
Public Member Functions | List of all members
produtil.log.MasterLogFormatter Class Reference

This is a custom log formatter that inserts the thread or process (logthread) that generated the log message. More...

Detailed Description

This is a custom log formatter that inserts the thread or process (logthread) that generated the log message.

Also, it always directly calls formatException from format, ensuring that cached information is not used. That allows a subclass (JLogFormatter) to ignore exceptions.

Definition at line 64 of file log.py.

Inheritance diagram for produtil.log.MasterLogFormatter:
produtil.log.JLogFormatter

Public Member Functions

def __init__
 MasterLogFormatter constructor. More...
 
def logthread (self)
 The name of the batch thread or process that generated log messages, if the LogRecord does not supply that already. More...
 
def format (self, record)
 Replaces the logging.Formatter.format() function. More...
 

Constructor & Destructor Documentation

def produtil.log.MasterLogFormatter.__init__ (   self,
  fmt = None,
  datefmt = None,
  logthread = None 
)

MasterLogFormatter constructor.

Parameters
fmtthe log message format
datefmtthe date format
logthreadthe thread name for logging
Note
See the Python logging module documentation for details.

Definition at line 70 of file log.py.

Member Function Documentation

def produtil.log.MasterLogFormatter.format (   self,
  record 
)

Replaces the logging.Formatter.format() function.

We need to override this due to a "feature" in the Formatter.format: It ignores formatException (never calls it) and caches the exception info, even if the formatter is not supposed to output it.

Parameters
recordthe log record to format
Note
See the Python logging module documentation for details.

Definition at line 85 of file log.py.

def produtil.log.MasterLogFormatter.logthread (   self)

The name of the batch thread or process that generated log messages, if the LogRecord does not supply that already.

Definition at line 79 of file log.py.

Referenced by produtil.log.MasterLogFormatter.format().


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