On Tue, Oct 13, 2009 at 08:52:48AM +0200, Lutz Steinborn wrote: > is there a way to log the query that SQLObject generates ?
Sure. You can turn on debug flag in DB URI or connection: __connection__ = 'sqlite:///path/to/db?debug=1' With debug turned on SQLObject prints queries to stdout, so you can redirect the stdout of your program or sys.stdout. You can also redirect this printing to stderr: __connection__ = 'sqlite:///path/to/db?debug=1&loglevel=stderr' To use logging instead of printing you have to name both the logger and the loglevel: __connection__ = 'sqlite:///path/to/db?logger=sqllog&loglevel=debug' 'logger' is any log name, see http://sqlobject.org/SQLObject.html#dbconnection-database-connections for details on configuring logging. 'loglevel' in this case must be a logging method (debug, info, warning, error, critical, exception). SQLObject (DBConnection, actually) emits a number of logging messages, see method printDebug at http://svn.colorstudy.com/SQLObject/trunk/sqlobject/dbconnection.py Oleg. -- Oleg Broytman http://phd.pp.ru/ p...@phd.pp.ru Programmers don't die, they just GOSUB without RETURN. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss