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)
| 1396 | is full, or when an event of a certain severity or greater is seen. |
| 1397 | """ |
| 1398 | def __init__(self, capacity, flushLevel=logging.ERROR, target=None, |
| 1399 | flushOnClose=True): |
| 1400 | """ |
| 1401 | Initialize the handler with the buffer size, the level at which |
| 1402 | flushing should occur and an optional target. |
| 1403 | |
| 1404 | Note that without a target being set either here or via setTarget(), |
| 1405 | a MemoryHandler is no use to anyone! |
| 1406 | |
| 1407 | The ``flushOnClose`` argument is ``True`` for backward compatibility |
| 1408 | reasons - the old behaviour is that when the handler is closed, the |
| 1409 | buffer is flushed, even if the flush level hasn't been exceeded nor the |
| 1410 | capacity exceeded. To prevent this, set ``flushOnClose`` to ``False``. |
| 1411 | """ |
| 1412 | BufferingHandler.__init__(self, capacity) |
| 1413 | self.flushLevel = flushLevel |
| 1414 | self.target = target |
| 1415 | # See Issue #26559 for why this has been added |
| 1416 | self.flushOnClose = flushOnClose |
| 1417 | |
| 1418 | def shouldFlush(self, record): |
| 1419 | """ |