logging.handlers.MemoryHandler

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 to None 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.

doc_python
2016-10-07 17:36:10
Comments
Leave a Comment

Please login to continue.