[New-bugs-announce] [issue32934] logging.handlers.BufferingHandler capacity is unclearly specified

Enrico Zini report at bugs.python.org
Sat Feb 24 05:24:49 EST 2018


New submission from Enrico Zini <enrico at enricozini.org>:

BufferingHandler's documentatio says "Initializes the handler with a buffer of the specified capacity." but it does not specify what capacity means. One would assume the intention is to give a bound to memory usage, and that capacity is bytes.

Looking at the source instead, the check is:

        return (len(self.buffer) >= self.capacity)

and self.buffer is initialised with an empty list, so capacity is a number of lines, which cannot be used to constrain memory usage, and for which I struggle to see a use case.

I believe that the current behaviour is counterintuitive enough to deserve, if not changing, at least documenting

----------
components: Library (Lib)
messages: 312709
nosy: enrico
priority: normal
severity: normal
status: open
title: logging.handlers.BufferingHandler capacity is unclearly specified
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32934>
_______________________________________


More information about the New-bugs-announce mailing list