MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/logging/handlers.py:1398–1416  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected