class documentation

class twisted.logger.LimitedHistoryLogObserver: (source)

View In Hierarchy

ILogObserver that stores events in a buffer of a fixed size:

    >>> from twisted.logger import LimitedHistoryLogObserver
    >>> history = LimitedHistoryLogObserver(5)
    >>> for n in range(10): history({'n': n})
    ...
    >>> repeats = []
    >>> history.replayTo(repeats.append)
    >>> len(repeats)
    5
    >>> repeats
    [{'n': 5}, {'n': 6}, {'n': 7}, {'n': 8}, {'n': 9}]
    >>>
Method __init__
Method __call__ Undocumented
Method replayTo Re-play the buffered events to another log observer.
Instance Variable _buffer Undocumented
def __init__(self, size=_DEFAULT_BUFFER_MAXIMUM): (source)
ParameterssizeThe maximum number of events to buffer. If None, the buffer is unbounded. (type: Optional[int])
_buffer = (source)

Undocumented

(type: Deque[LogEvent])
def __call__(self, event): (source)

Undocumented

ParameterseventUndocumented (type: LogEvent)
def replayTo(self, otherObserver): (source)

Re-play the buffered events to another log observer.

ParametersotherObserverAn observer to replay events to. (type: ILogObserver)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.