webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Public Attributes | List of all members
compat_logging.handlers.BufferingHandler Class Reference
Inheritance diagram for compat_logging.handlers.BufferingHandler:
compat_logging.handlers.MemoryHandler

Public Member Functions

def __init__ (self, capacity)
 
def shouldFlush (self, record)
 
def emit (self, record)
 
def flush (self)
 

Public Attributes

 capacity
 
 buffer
 

Detailed Description

  A handler class which buffers logging records in memory. Whenever each
  record is added to the buffer, a check is made to see if the buffer should
  be flushed. If it should, then flush() is expected to do what's needed.

Constructor & Destructor Documentation

◆ __init__()

def compat_logging.handlers.BufferingHandler.__init__ (   self,
  capacity 
)
Initialize the handler with the buffer size.

Member Function Documentation

◆ emit()

def compat_logging.handlers.BufferingHandler.emit (   self,
  record 
)
Emit a record.

Append the record. If shouldFlush() tells us to, call flush() to process
the buffer.

◆ flush()

def compat_logging.handlers.BufferingHandler.flush (   self)
Override to implement custom flushing behaviour.

This version just zaps the buffer to empty.

◆ shouldFlush()

def compat_logging.handlers.BufferingHandler.shouldFlush (   self,
  record 
)
Should the handler flush its buffer?

Returns true if the buffer is up to capacity. This method can be
overridden to implement custom flushing strategies.

Member Data Documentation

◆ buffer

compat_logging.handlers.BufferingHandler.buffer

◆ capacity

compat_logging.handlers.BufferingHandler.capacity

The documentation for this class was generated from the following file: