Commits

Jean-Tiare Le Bigot committed b9e5e7e

enhanced log messages

  • Participants
  • Parent commits 124406b

Comments (0)

Files changed (1)

dynamodb_mapper/model.py

         if hash_key_type is autoincrement_int:
             self._create_autoincrement_magic_item(table)
 
+        dblog.debug("Created table %s(%s, %s)", cls.__table__, hash_key_name, range_key_name)
+
         return table
 
     def get_table(self, name):
                     range_key=r_value,
                     consistent_read=consistent_read)
 
-        dblog.debug("[GET] %s(%s, %s)", cls.__table__, h_value, r_value)
+        dblog.debug("Got item (%s, %s) from table %s", h_value, r_value, cls.__table__)
 
         return cls.from_dict(item)
 
 
         res = batch_list.submit()
 
-        dblog.debug("[BATCH GET] %s", cls.__table__)
+        dblog.debug("Sent a batch get on table %s", cls.__table__)
 
         return [
             cls.from_dict(d) for d in res[u"Responses"][cls.__table__][u"Items"]
                 consistent_read=consistent_read,
                 scan_index_forward=not reverse)
 
-        dblog.debug("[QUERY] %s(%s, %s)", cls.__table__, h_value, range_key_condition)
+        dblog.debug("Queried (%s, %s) on table", h_value, range_key_condition, cls.__table__)
 
         return (cls.from_dict(d) for d in res)
 
 
         res = table.scan(scan_filter)
 
-        dblog.debug("[QUERY] %s(%s)", cls.__table__, scan_filter)
+        dblog.debug("Scanned table %s with filter %s", cls.__table__, scan_filter)
 
         return (
             cls.from_dict(d)
 
         hash_key_value = getattr(self, hash_key)
         range_key_value = getattr(self, hash_key, None)
-        dblog.debug("[SAVE] %s(%s, %s) allow_overwrite=%s", cls.__table__, hash_key_value, range_key_value, allow_overwrite)
+        dblog.debug("Saved (%s, %s) in table %s allow_overwrite=%s", hash_key_value, range_key_value, cls.__table__, allow_overwrite)
 
     def delete(self):
         """Delete the current object from the database."""
         table = ConnectionBorg().get_table(cls.__table__)
         Item(table, hash_key_value, range_key_value).delete()
 
-        dblog.debug("[DELETE] %s(%s, %s)", cls.__table__, hash_key_value, range_key_value)
+        dblog.debug("Deleted (%s, %s) from table %s", hash_key_value, range_key_value, cls.__table__)