[Zope-DB] insert failing without raising exception: postgresql, psycopg

Chris Withers chris at simplistix.co.uk
Thu Nov 24 02:40:41 EST 2005


Dieter Maurer wrote:
> freeman at tllc.com wrote at 2005-11-23 06:51 -0800:
> 
>>...
>>I regret that I have not yet learned how to "add logging" to
>>ZPsycopgDA, and will appreciate learning how to do so.
> 
> 
> It looks like this ("ZPsycopgDA/db.py"):
> 
> from zLOG import LOG, ERROR, INFO, PROBLEM
> ...
> 
> 	LOG('Postgres', INFO, summary, details)

please don't encourage this old and ugly logging style...

import logging
logger = logging.getLogger('event.Postgres')

logger.info('Count is %i', count)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope-DB mailing list