Clearing out handlers in logging?
python.list at tim.thechases.com
Sun Mar 16 19:50:26 CET 2014
On 2014-03-16 19:29, Gunther Dietrich wrote:
> >> Indeed, THERE IS a removeHandler() method.
> >Yes, I'm aware of it, having read the source & docs. However, the
> >signature is
> Sorry, your original article lacks information about what you
> already know/tried and what not. So it is a bit misleading and
> makes the impression, you would't read the documentation. It would
> have been helpful if you had told us your preconditions.
Heh, I tried to make that clear in my initial posting with the "since
there are other methods for adding/removing handlers" bit. I guess I
could have been more explicit though as to what I'd tried. I
generally figure that, if someone knows enough to dig into the
stdlib's source code, they also know enough to use dir() and help().
Not *always* the case, but a good hint that they're past the basics.
But I could have clarified my question more along the lines of
"Should log.handlers be public/documented; should Logger grow
clearHandlers() and iterHandlers() methods; or should I wantonly use
log.handlers but then just get to keep both pieces if/when it breaks?"
More information about the Python-list