incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1441359 - in /incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct: multiproduct/dbcursor.py tests/env.py
Date Fri, 01 Feb 2013 09:29:25 GMT
Author: jure
Date: Fri Feb  1 09:29:25 2013
New Revision: 1441359

URL: http://svn.apache.org/viewvc?rev=1441359&view=rev
Log:
#355, enable SQL debugging, patch t355_r1440987_dbcursor_debug_sql (from Olemis)


Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/env.py

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py?rev=1441359&r1=1441358&r2=1441359&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
Fri Feb  1 09:29:25 2013
@@ -55,7 +55,11 @@ class BloodhoundIterableCursor(trac.db.u
     def _translate_sql(self, sql):
         if self._translator is translator_not_set:
             self._translator = None
-            if not self.env is None:
+            if self.env is not None:
+                # FIXME: This is the right way to do it but breaks translation
+                # if trac.db.api.DatabaseManager(self.env).debug_sql:
+                if (self.env.parent or self.env).config['trac'].get('debug_sql', False):
+                    self.log = self.env.log
                 product_prefix = self.env.product.prefix if self.env.product else GLOBAL_PRODUCT
                 self._translator = BloodhoundProductSQLTranslate(SKIP_TABLES,
                                                                  TRANSLATE_TABLES,

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/env.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/env.py?rev=1441359&r1=1441358&r2=1441359&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/env.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/env.py
Fri Feb  1 09:29:25 2013
@@ -138,6 +138,10 @@ class MultiproductTestCase(unittest.Test
         config.set('logging', 'log_file', logpath)
         config.set('logging', 'log_type', 'file')
         config.set('logging', 'log_level', 'DEBUG')
+
+        # Log SQL queries
+        config.set('trac', 'debug_sql', True)
+
         config.save()
         env.setup_log()
         env.log.info('%s test case: %s %s',



Mime
View raw message