class twisted.logger.LimitedHistoryLogObserver: (source)
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 |
Re-play the buffered events to another log observer.
Parameters | otherObserver | An observer to replay events to. (type: ILogObserver ) |