Initialize the handler with the buffer size, the level at which flushing should occur and an optional target. Note that without a target being set either here or via setTarget(), a MemoryHandler is no use to anyone! The ``flushOnClose`` argument is ``True``
(self, capacity, flushLevel=logging.ERROR, target=None,
flushOnClose=True)
| 1376 | is full, or when an event of a certain severity or greater is seen. |
| 1377 | """ |
| 1378 | def __init__(self, capacity, flushLevel=logging.ERROR, target=None, |
| 1379 | flushOnClose=True): |
| 1380 | """ |
| 1381 | Initialize the handler with the buffer size, the level at which |
| 1382 | flushing should occur and an optional target. |
| 1383 | |
| 1384 | Note that without a target being set either here or via setTarget(), |
| 1385 | a MemoryHandler is no use to anyone! |
| 1386 | |
| 1387 | The ``flushOnClose`` argument is ``True`` for backward compatibility |
| 1388 | reasons - the old behaviour is that when the handler is closed, the |
| 1389 | buffer is flushed, even if the flush level hasn't been exceeded nor the |
| 1390 | capacity exceeded. To prevent this, set ``flushOnClose`` to ``False``. |
| 1391 | """ |
| 1392 | BufferingHandler.__init__(self, capacity) |
| 1393 | self.flushLevel = flushLevel |
| 1394 | self.target = target |
| 1395 | # See Issue #26559 for why this has been added |
| 1396 | self.flushOnClose = flushOnClose |
| 1397 | |
| 1398 | def shouldFlush(self, record): |
| 1399 | """ |