class documentation
class ACMERingBufferLogHandler(logging.Handler, RingBuffer[
Constructor: ACMERingBufferLogHandler(capacity)
A ring buffer handler for logging. It buffers log records and flushes them to the console or file when the buffer is full.
| Method | __init__ |
Initialize the ring buffer handler with a given capacity. |
| Method | emit |
Emit a log record to the buffer. |
| Method | get |
Get a log entry from the buffer by index. |
Inherited from RingBuffer:
| Method | __getitem__ |
Get an item from the buffer by index. |
| Method | append |
Add an item to the ring buffer. If the buffer is full, the oldest item is removed. |
| Method | increment |
Increment the head in a circular manner. |
| Method | next |
Increment an index in a circular manner without modifying the current index. |
| Instance Variable | buffer |
The internal storage for the ring buffer, initialized with None values. |
| Instance Variable | capacity |
The maximum number of items the buffer can hold. |
| Instance Variable | head |
The current head index of the ring buffer, initialized to -1 indicating an empty buffer. |
Initialize the ring buffer handler with a given capacity.
| Parameters | |
capacity:int | The maximum number of log records to keep in the buffer. |