From 45428c25dffa1dff16bedb87ffb05615ab002a5e Mon Sep 17 00:00:00 2001
From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com>
Date: Fri, 21 Jun 2019 19:42:33 +0200
Subject: [PATCH] bitbucket: Unify logging instructions

---
 swh/lister/bitbucket/tasks.py      | 2 +-
 swh/lister/core/indexing_lister.py | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/swh/lister/bitbucket/tasks.py b/swh/lister/bitbucket/tasks.py
index 5477b948..1bb00c97 100644
--- a/swh/lister/bitbucket/tasks.py
+++ b/swh/lister/bitbucket/tasks.py
@@ -35,7 +35,7 @@ def full_bitbucket_relister(self, split=None, **lister_args):
     random.shuffle(ranges)
     promise = group(range_bitbucket_lister.s(minv, maxv, **lister_args)
                     for minv, maxv in ranges)()
-    self.log.debug('%s OK (spawned %s subtasks)' % (self.name, len(ranges)))
+    self.log.debug('%s OK (spawned %s subtasks)', (self.name, len(ranges)))
     try:
         promise.save()  # so that we can restore the GroupResult in tests
     except (NotImplementedError, AttributeError):
diff --git a/swh/lister/core/indexing_lister.py b/swh/lister/core/indexing_lister.py
index 3cc545fa..2fdc2dd4 100644
--- a/swh/lister/core/indexing_lister.py
+++ b/swh/lister/core/indexing_lister.py
@@ -218,15 +218,16 @@ class IndexingLister(ListerBase):
 
                 # termination condition
                 if next_index is None or next_index == index:
-                    logger.info('stopping after index %s, no next link found' %
+                    logger.info('stopping after index %s, no next link found',
                                 index)
                     return
                 index = next_index
+                logger.debug('Index: %s', index)
                 yield i
 
         for i in ingest_indexes():
             if (i % 20) == 0:
-                logger.info('flushing updates')
+                logger.debug('Flushing updates at index %s', i)
                 self.db_session.commit()
                 self.db_session = self.mk_session()
 
-- 
GitLab