pgtoolkit/pgmanager.py
changeset 89 6b72d61837b1
parent 81 f709b1c7ca0c
child 101 2a2d0d5df03b
equal deleted inserted replaced
88:b8b2d28a7f35 89:6b72d61837b1
   204         rows = super(Cursor, self).fetchall()
   204         rows = super(Cursor, self).fetchall()
   205         return [self.row_dict([self.mogrify('%s', [x]).decode('utf8') for x in row], lstrip) for row in rows]
   205         return [self.row_dict([self.mogrify('%s', [x]).decode('utf8') for x in row], lstrip) for row in rows]
   206 
   206 
   207     def _log_query(self, query='?', args=None):
   207     def _log_query(self, query='?', args=None):
   208         name = self.connection.name if hasattr(self.connection, 'name') else '-'
   208         name = self.connection.name if hasattr(self.connection, 'name') else '-'
   209         query = self.query or self.mogrify(query, args)
   209         query = self.mogrify(query, args)
   210         log_sql.debug('[%s] %s' % (name, query.decode('utf8')))
   210         log_sql.debug('[%s] %s' % (name, query.decode('utf8')))
   211 
   211 
   212     def _log_exception(self):
   212     def _log_exception(self):
   213         name = self.connection.name if hasattr(self.connection, 'name') else '-'
   213         name = self.connection.name if hasattr(self.connection, 'name') else '-'
   214         log_sql.exception('[%s] exception:' % (name,))
   214         log_sql.exception('[%s] exception:' % (name,))