HWRF
trunk@4391
|
This is a custom log formatter that inserts the thread or process (logthread) that generated the log message. More...
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.
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... | |
def produtil.log.MasterLogFormatter.__init__ | ( | self, | |
fmt = None , |
|||
datefmt = None , |
|||
logthread = None |
|||
) |
MasterLogFormatter constructor.
fmt | the log message format |
datefmt | the date format |
logthread | the thread name for logging |
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.
record | the log record to format |
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().