New submission from Enrico Zini <[email protected]>:
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 <[email protected]>
<https://bugs.python.org/issue32934>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com