class documentation
class LimitedHistoryLogObserver: (source)
Constructor: LimitedHistoryLogObserver(size)
Implements interfaces: twisted.logger.ILogObserver
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 | __call__ |
Log an event. |
Method | __init__ |
No summary |
Method | replay |
Re-play the buffered events to another log observer. |
Instance Variable | _buffer |
Undocumented |
Log an event.
Parameters | |
event:LogEvent | A dictionary with arbitrary keys as defined by the application emitting logging events, as well as keys added by the logging system. The logging system reserves the right to set any key beginning with the prefix "log_"; applications should not use any key so named. Currently, the following keys are used by the logging system in some way, if they are present (they are all optional):
|