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,)) |