mytoolkit/mymanager.py
changeset 77 2cfef775f518
parent 75 39f777341db4
equal deleted inserted replaced
76:3a41b351b122 77:2cfef775f518
   142             query = query % db.literal(args)
   142             query = query % db.literal(args)
   143         return query
   143         return query
   144 
   144 
   145     def _log_query(self, query, args):
   145     def _log_query(self, query, args):
   146         name = self.connection.name if hasattr(self.connection, 'name') else '-'
   146         name = self.connection.name if hasattr(self.connection, 'name') else '-'
   147         query = self._executed or self.mogrify(query, args)
   147         query = self.mogrify(query, args)
   148         if isinstance(query, bytes):
   148         if isinstance(query, bytes):
   149             db = self._get_db()
   149             db = self._get_db()
   150             charset = db.character_set_name()
   150             charset = db.character_set_name()
   151             query = query.decode(charset)
   151             query = query.decode(charset)
   152         log_sql.info('[%s] %s' % (name, query))
   152         log_sql.debug('[%s] %s' % (name, query))
   153 
   153 
   154 
   154 
   155 class MyManager:
   155 class MyManager:
   156 
   156 
   157     def __init__(self):
   157     def __init__(self):