Re: ThreadedConnectionPool and Cherrypy
Federico Di Gregorio <fog@...
2010-06-25 10:00:47 GMT
On 25/06/2010 10:47, Joe Abbate wrote:
> Hi Federico,
> On 06/25/2010 04:04 AM, Federico Di Gregorio wrote:
>> psycopg should not initialize the logging module if already initialized.
>> I supposed logging.basicConfig() would take care of that but it doesn't
>> seems so. Can you please comment that line in pool.py an tell us what
> If I comment out the logging.basicConfig() in pool.py, the duplicate
> INFO-level log lines go away.
The documentation for basicConfig says:
Does basic configuration for the logging system by creating a
StreamHandler with a default Formatter and adding it to the root logger.
The function does nothing if any handlers have been defined for
the root logger. The functions debug(), info(), warning(), error() and
critical() will call basicConfig() automatically if no handlers are
defined for the root logger.
So, probably, psycopg.pool is imported before other modules and the
other modules add handlers anyway. I'd say this is a psycopg bug that
being a library should not initialize the logging system. Will fix this
when I understand exactly what I library should do; in the meantime just
leave the comment in place.
Federico Di Gregorio <mailto:fog@...> <jid:fog@...>
DISCLAIMER. If I receive a message from you, you are agreeing that:
1. I am by definition, "the intended recipient".
2. All information in the email is mine to do with as I see fit and
make such financial profit, political mileage, or good joke as it lends
itself to. In particular, I may quote it on USENET or the WWW.
3. I may take the contents as representing the views of your company.
4. This overrides any disclaimer or statement of confidentiality that
may be included on your message.
Psycopg mailing list