[DB-SIG] Extending DB-API

Ian Bicking ianb at colorstudy.com
Mon Nov 20 19:25:46 CET 2006


Mario Frasca wrote:
> On 2006-1116 12:59:28, Ian Bicking wrote:
>> The major things I think we can standardize:
> 
> may I propose one more point...
> 
> what about using the standard logging module (if available) to unify
> the logging style?  I would be happy if a db-api2 module would...
> 
> * expose a logger named as the module,
> * set its verbosity to logging.WARNING (or ERROR),
> * log relevant errors, warning and debug info at the proper level,
> * log SQL commands at INFO level (maybe long parameters lists as DEBUG?)
> 
> a program loading the module may choose to modify the logging level
> of the module and get all information generated by the module into the
> handlers defined by the program.
> 
> what do you think about it?

It's possible to resolve this through a wrapper around the connection. 
For instance: 
http://svn.sqlobject.org/sqlapi/trunk/sqlapi/connect/wrapper.py

I suppose the problems with multiple exception hierarchies could also be 
resolved this way.

-- 
Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org


More information about the DB-SIG mailing list