Re: logging module: removing handlers

2007-11-21 Thread Michele Simionato
On Nov 21, 11:08 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Having thought more about this, it _has_ to be that way - think of one > handler attached to several loggers. Removing AND closing it from one would > render it useless for others. You can't want that to happen. You have a point.

Re: logging module: removing handlers

2007-11-21 Thread Diez B. Roggisch
Michele Simionato wrote: > On Nov 21, 10:23 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> I can only guess - but I'd say if you can do >> >> foo.removeHandler(h) >> >> you can do >> >> foo.removeHandler(h) >> h.close() >> >> easily. But not >> >> foo.removeHandler(h) # implicit closing >

Re: logging module: removing handlers

2007-11-21 Thread Michele Simionato
On Nov 21, 10:23 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > I can only guess - but I'd say if you can do > > foo.removeHandler(h) > > you can do > > foo.removeHandler(h) > h.close() > > easily. But not > > foo.removeHandler(h) # implicit closing > bar.addHandler(h) > > It does kind of mak

Re: logging module: removing handlers

2007-11-21 Thread Diez B. Roggisch
Michele Simionato schrieb: > I have just discovered a bug in my code using the logging module, due > to > handlers not being closed properly. The issue was that I called the > function > removeHandler and I assumed that it took care of closing the handler, > but it did not. > Looking at the source

logging module: removing handlers

2007-11-21 Thread Michele Simionato
I have just discovered a bug in my code using the logging module, due to handlers not being closed properly. The issue was that I called the function removeHandler and I assumed that it took care of closing the handler, but it did not. Looking at the source code of logging/__init__.py I discovered