[Tutor] python logging module: two handlers writing to the same file - okay?

Kent Johnson kent37 at tds.net
Sat Dec 15 17:34:37 CET 2007


Ricardo Aráoz wrote:
> Kent Johnson wrote:
>> I don't know the answer, but it has nothing to do with the logging 
>> module. The question is, can the same file reliably be opened twice for 
>> writing in the same module.
> 
> Well, the question would actually be if the logging module is smart
> enough to find out that both your filehandlers are referring to the same
> file and open it only once.

A quick glance at the logging module shows that it is not that smart. It 
just opens the file twice; hence my original question.

Kent


More information about the Tutor mailing list