[native] Change SQL errors log level.
authorChristophe de Vienne <christophe@unlish.com>
Mon, 29 Dec 2014 12:35:34 +0100
changeset 10178 4b33246cb43c
parent 10159 5cc8fdba56d5
child 10179 a328b91938b2
[native] Change SQL errors log level. - The SQL error itself is logged as 'info'. - The 'transaction has been rolled back' message is logged as 'debug'. These log entries should not be critical: - If an error occur at the sql level, it will be transmitted as a CW error. The exception is raised and handled in a higher level function, which will decide if it is critical or not. - Admitting that rolling-back automatically on errors is wanted in some cases, it cannot be considered 'critical'. The caller will receive the original exception anyway, it is its job to decide if it is critical or not. Closes #4801120
server/sources/native.py
--- a/server/sources/native.py	Thu Jan 22 17:39:07 2015 +0100
+++ b/server/sources/native.py	Mon Dec 29 12:35:34 2014 +0100
@@ -707,13 +707,13 @@
             if self.repo.config.mode != 'test':
                 # during test we get those message when trying to alter sqlite
                 # db schema
-                self.critical("sql: %r\n args: %s\ndbms message: %r",
+                self.info("sql: %r\n args: %s\ndbms message: %r",
                               query, args, ex.args[0])
             if rollback:
                 try:
                     cnx.cnxset.rollback()
                     if self.repo.config.mode != 'test':
-                        self.critical('transaction has been rolled back')
+                        self.debug('transaction has been rolled back')
                 except Exception as ex:
                     pass
             if ex.__class__.__name__ == 'IntegrityError':