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

Custom LogHandler for the master process of a multi-process job. More...

Detailed Description

Custom LogHandler for the master process of a multi-process job.

This is a custom logging Handler class used for multi-process or multi-job batch scripts. It has a higher minimum log level for messages not sent to the jlogfile domain. Also, for every log message, the log file is opened, the message is written and the file is closed. This is done to mimic the postmsg command. Exception information is never sent to the log file.

Definition at line 132 of file log.py.

Inheritance diagram for produtil.log.MasterLogHandler:
produtil.log.JLogHandler

Public Member Functions

def __init__ (self, logger, jlogdomain, otherlevels, joformat, jformat)
 Custom LogHandler for the master process of a multi-process job. More...
 
def stringify_record (self, record)
 Convert a log record to a string. More...
 
def emit (self, record)
 Write a log message. More...
 

Constructor & Destructor Documentation

def produtil.log.MasterLogHandler.__init__ (   self,
  logger,
  jlogdomain,
  otherlevels,
  joformat,
  jformat 
)

Custom LogHandler for the master process of a multi-process job.

This is a custom logging Handler class used for multi-process or multi-job batch scripts. It has a higher minimum log level for messages not sent to the jlogfile domain. Also, for every log message, the log file is opened, the message is written and the file is closed. This is done to mimic the postmsg command. Exception information is never sent to the log file. MasterLogHandler constructor

Parameters
loggerThe logging.Logger for the master process.
jlogdomainThe logging domain for the jlogfile.
otherlevelsLog level for any extrema to go to the jlogfile.
joformatLog format for other streams.
jformatLog format for the jlogfile stream.

Definition at line 141 of file log.py.

Member Function Documentation

def produtil.log.MasterLogHandler.emit (   self,
  record 
)

Write a log message.

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

Definition at line 170 of file log.py.

def produtil.log.MasterLogHandler.stringify_record (   self,
  record 
)

Convert a log record to a string.

Note
See the Python logging module documentation for details.
Returns
a string message to print

Definition at line 154 of file log.py.

Referenced by produtil.log.MasterLogHandler.emit(), and produtil.log.JLogHandler.emit().


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