# HG changeset patch # User Laurent Peuch # Date 1566355928 -7200 # Node ID 6e98699d3a9a4e7427a67d6f82639157e0854111 # Parent c6f8ca03718fa3554b46825c58982a195f5c9462 [logging/debug] move transaction operations logs from self.debug to DBG_OPS There were a mixing between displaying transaction operations log on logger.debug and only when DBG_OPS was on, uniformize everything behind DBG_OPS. Closes #17229126 diff -r c6f8ca03718f -r 6e98699d3a9a cubicweb/server/session.py --- a/cubicweb/server/session.py Wed Aug 21 02:10:12 2019 +0200 +++ b/cubicweb/server/session.py Wed Aug 21 04:52:08 2019 +0200 @@ -674,6 +674,7 @@ def rollback(self): """rollback the current transaction""" cnxset = self.cnxset + debug = server.DEBUG & server.DBG_OPS assert cnxset is not None try: # by default, operations are executed with security turned off @@ -686,7 +687,8 @@ self.critical('rollback error', exc_info=sys.exc_info()) continue cnxset.rollback() - self.debug('rollback for transaction %s done', self) + if debug: + print('rollback for transaction %s done' % self) finally: self.clear() @@ -726,7 +728,8 @@ print(operation) operation.handle_event('precommit_event') self.pending_operations[:] = processed - self.debug('precommit transaction %s done', self) + if debug: + print('precommit transaction %s done' % self) except BaseException: # if error on [pre]commit: # @@ -772,7 +775,8 @@ raise self.critical('error while postcommit', exc_info=sys.exc_info()) - self.debug('postcommit transaction %s done', self) + if debug: + print('postcommit transaction %s done' % self) return self.transaction_uuid(set=False) finally: self.clear()