Skip to content
This repository

Fix logging error statements. #8

Merged
merged 1 commit into from almost 2 years ago

2 participants

Bojan Mihelac Jens Diemer
Jens Diemer jedie merged commit 32e6211 into from
Jens Diemer jedie closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 20, 2012
Bojan Mihelac Fix logging error statements. 82bf171
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 19 additions and 19 deletions. Show diff stats Hide diff stats

  1. 38  reversion_compare/admin.py
38  reversion_compare/admin.py
@@ -121,10 +121,10 @@ def get_many_to_many(self):
121 121
             content_type=ContentType.objects.get_for_model(related_model),
122 122
             object_id__in=ids
123 123
         )
124  
-#        logger.debug("m2m queryset:", queryset)
  124
+#        logger.debug("m2m queryset: %s", queryset)
125 125
 
126 126
         versions = sorted(list(queryset))
127  
-#        logger.debug("versions:", versions)
  127
+#        logger.debug("versions: %s", versions)
128 128
 
129 129
         if self.has_int_pk:
130 130
             # The primary_keys would be stored in a text field -> convert it to integers
@@ -272,22 +272,22 @@ def get_m2m_change_info(self):
272 272
 #        missing_objects_pk2 = [obj.pk for obj in missing_objects2]
273 273
         missing_objects_dict2 = dict([(obj.pk, obj) for obj in missing_objects2])
274 274
 
275  
-        # logger.debug("missing_objects1:", missing_objects1)
276  
-        # logger.debug("missing_objects2:", missing_objects2)
277  
-        # logger.debug("missing_ids1:", missing_ids1)
278  
-        # logger.debug("missing_ids2:", missing_ids2)
  275
+        # logger.debug("missing_objects1: %s", missing_objects1)
  276
+        # logger.debug("missing_objects2: %s", missing_objects2)
  277
+        # logger.debug("missing_ids1: %s", missing_ids1)
  278
+        # logger.debug("missing_ids2: %s", missing_ids2)
279 279
 
280 280
         missing_object_set1 = set(missing_objects1)
281 281
         missing_object_set2 = set(missing_objects2)
282  
-        # logger.debug(missing_object_set1, missing_object_set2)
  282
+        # logger.debug("%s %s", missing_object_set1, missing_object_set2)
283 283
 
284 284
         same_missing_objects = missing_object_set1.intersection(missing_object_set2)
285 285
         removed_missing_objects = missing_object_set1.difference(missing_object_set2)
286 286
         added_missing_objects = missing_object_set2.difference(missing_object_set1)
287 287
 
288  
-        # logger.debug("same_missing_objects:", same_missing_objects)
289  
-        # logger.debug("removed_missing_objects:", removed_missing_objects)
290  
-        # logger.debug("added_missing_objects:", added_missing_objects)
  288
+        # logger.debug("same_missing_objects: %s", same_missing_objects)
  289
+        # logger.debug("removed_missing_objects: %s", removed_missing_objects)
  290
+        # logger.debug("added_missing_objects: %s", added_missing_objects)
291 291
 
292 292
 
293 293
         # Create same_items, removed_items, added_items with related m2m items
@@ -317,19 +317,19 @@ def get_m2m_change_info(self):
317 317
             else:
318 318
                 version2 = None
319 319
 
320  
-            #logger.debug("%r - %r - %r" % (primary_key, version1, version2))
  320
+            #logger.debug("%r - %r - %r", primary_key, version1, version2)
321 321
 
322 322
             if version1 is not None and version2 is not None:
323 323
                 # In both -> version changed or the same
324 324
                 if version1.serialized_data == version2.serialized_data:
325  
-                    #logger.debug("same item:", version1)
  325
+                    #logger.debug("same item: %s", version1)
326 326
                     same_items.append(version1)
327 327
                 else:
328 328
                     changed_items.append((version1, version2))
329 329
             elif version1 is not None and version2 is None:
330 330
                 # In 1 but not in 2 -> removed
331  
-                #logger.debug(primary_key, missing_objects_pk2)
332  
-                #logger.debug(repr(primary_key), repr(missing_objects_pk2))
  331
+                #logger.debug("%s %s", primary_key, missing_objects_pk2)
  332
+                #logger.debug("%s %s", repr(primary_key), repr(missing_objects_pk2))
333 333
                 if primary_key in missing_objects_dict2:
334 334
                     missing_object = missing_objects_dict2[primary_key]
335 335
                     added_missing_objects.remove(missing_object)
@@ -339,7 +339,7 @@ def get_m2m_change_info(self):
339 339
                 removed_items.append(version1)
340 340
             elif version1 is None and version2 is not None:
341 341
                 # In 2 but not in 1 -> added
342  
-                #logger.debug("added:", version2)
  342
+                #logger.debug("added: %s", version2)
343 343
                 added_items.append(version2)
344 344
             else:
345 345
                 raise RuntimeError()
@@ -361,8 +361,8 @@ def debug(self):
361 361
             return
362 362
         logger.debug("_______________________________")
363 363
         logger.debug(" *** CompareObjects debug: ***")
364  
-        logger.debug("changed:", self.changed())
365  
-        logger.debug("follow:", self.follow)
  364
+        logger.debug("changed: %s", self.changed())
  365
+        logger.debug("follow: %s", self.follow)
366 366
 
367 367
         debug1 = self.compare_obj1.get_debug()
368 368
         debug2 = self.compare_obj2.get_debug()
@@ -522,7 +522,7 @@ def _get_compare(self, obj_compare):
522 522
         """
523 523
         def _get_compare_func(suffix):
524 524
             func_name = "compare_%s" % suffix
525  
-            # logger.debug("func_name:", func_name)
  525
+            # logger.debug("func_name: %s", func_name)
526 526
             if hasattr(self, func_name):
527 527
                 func = getattr(self, func_name)
528 528
                 return func
@@ -563,7 +563,7 @@ def compare(self, obj, version1, version2):
563 563
         has_unfollowed_fields = False
564 564
 
565 565
         for field in fields:
566  
-            #logger.debug(field, field.db_type, field.get_internal_type())
  566
+            #logger.debug("%s %s %s", field, field.db_type, field.get_internal_type())
567 567
 
568 568
             field_name = field.name
569 569
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.