class logging.handlers.MemoryHandler(capacity, flushLevel=ERROR, target=None)
Returns a new instance of the MemoryHandler
class. The instance is initialized with a buffer size of capacity. If flushLevel is not specified, ERROR
is used. If no target is specified, the target will need to be set using setTarget()
before this handler does anything useful.
-
close()
-
Calls
flush()
, sets the target toNone
and clears the buffer.
-
flush()
-
For a
MemoryHandler
, flushing means just sending the buffered records to the target, if there is one. The buffer is also cleared when this happens. Override if you want different behavior.
-
setTarget(target)
-
Sets the target handler for this handler.
-
shouldFlush(record)
-
Checks for buffer full or a record at the flushLevel or higher.
Please login to continue.