class documentation
class OFMHandler(logging.Handler): (source)
Constructor: OFMHandler(level, max_logs)
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 |
Append the record as a dictionary to a log of records. |
| Method | emit |
Emit will save the logged record to the log. |
| Property | get |
Return the log history as a formatted string. |
| Property | log |
Return the log history up to the maximum number of logs. |
| Method | _as |
Format the record into the dictionary structure expected by the server. |
| Instance Variable | _log |
Undocumented |
| Instance Variable | _max |
Undocumented |
| Instance Variable | _running |
Undocumented |
Initialise the handler with a set logging level and message buffer size.
| Parameters | |
level:int | The level of logs captured. As standard logs of INFO and above are captured. |
maxint | The maximum number of logs to hold in memory. This sets how many can be returned over HTTP. |
Append the record as a dictionary to a log of records.
Any records in excess of the maximum number of logs are removed.
Return the log history as a formatted string.
This is to be used for the fallback server, the formatting does not contain invocation IDs as no actions should have started.
Return the log history up to the maximum number of logs.
Order is reversed so most recent logs are at the top.