class documentation

class OFMHandler(logging.Handler): (source)

Constructor: OFMHandler(level, max_logs)

View In Hierarchy

A logging.Handler that stores the most recent logs for access by the server.

Method __init__ Initialise the handler with a set logging level and message buffer size.
Method append_record Format message and append it to a list of records.
Method emit Emit will save the logged record to the log.
Property log_history Return the log history up to the maximum number of logs.
Instance Variable _log Undocumented
Instance Variable _max_logs Undocumented
def __init__(self, level=logging.INFO, max_logs=250): (source)

Initialise the handler with a set logging level and message buffer size.

Parameters
levelThe level of logs captured. As standard logs of INFO and above are captured.
max_logsThe maximum number of logs to hold in memory. This sets how many can be returned over HTTP.
def append_record(self, record): (source)

Format message and append it to a list of records.

The built in formatter is used to format the record.

Any records in excess of the maximum number of logs are removed.

def emit(self, record): (source)

Emit will save the logged record to the log.

@property
log_history = (source)

Return the log history up to the maximum number of logs.

_log: list = (source)

Undocumented

_max_logs = (source)

Undocumented