Re: ThreadedConnectionPool and Cherrypy

Joe Abbate <jma-ICVE9uepxrQgpMukQH3QewC/[email protected]> Fri, 25 Jun 2010 11:02:03 -0400
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
Hi Daniele,

On 06/25/2010 08:16 AM, Daniele Varrazzo wrote:
>
> If Joe wants to avoid duplicate logging in his app without changing
> psycopg code (e.g. if he's using a system version) he may try to fool
> the logging system by one of:
>
> - if his application installs handlers on the root logger, he may
> ensure that logging init is performed before importing psycopg
> - if he's not using handlers on the root logger, he may install a
> no-op handler before importing psycopg, e.g.
> logging.basicConfig(stream=open(os.devnull, 'a'))
> - if he thinks basicConfig is not a good idea, he may monkeypatch it
> away before importing psycopg: logging.basicConfig = lambda **kwargs:
> None
>    

Just to clarify, my application doesn't take any explicit action with 
respect to logging (except for defining log.error_file in the production 
configuration).  Therefore, CherryPy is the one that controls logging.  
The CP code is here:

http://www.cherrypy.org/browser/tags/cherrypy-3.1.2/cherrypy/_cplogging.py

Joe