From cf2cbb69534339c78f024e77ffd1f0a73505e4d5 Mon Sep 17 00:00:00 2001
From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com>
Date: Wed, 21 Sep 2016 09:59:18 +0200
Subject: [PATCH] Refactor logging warning/critical message

---
 swh/archiver/worker.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/swh/archiver/worker.py b/swh/archiver/worker.py
index 86f343a..02a955e 100644
--- a/swh/archiver/worker.py
+++ b/swh/archiver/worker.py
@@ -84,16 +84,16 @@ class BaseArchiveWorker(config.SWHConfig, metaclass=abc.ABCMeta):
             # for contents ignoring those who don't need archival.
             copies = self.compute_copies(set_objstorages, obj_id)
             if not copies:
-                logger.warning('Unknown content archiver-wise %s' %
-                               hashutil.hash_to_hex(obj_id))
+                msg = 'Unknown content %s' % hashutil.hash_to_hex(obj_id)
+                logger.warning(msg)
                 continue
             if not self.need_archival(copies):
                 continue
             present = copies.get('present', [])
             missing = copies.get('missing', [])
             if len(present) == 0:
-                logger.critical('Lost content %s' %
-                                hashutil.hash_to_hex(obj_id))
+                msg = 'Lost content %s' % hashutil.hash_to_hex(obj_id)
+                logger.critical(msg)
                 continue
             # Choose servers to be used as srcs and dests.
             for src_dest in self.choose_backup_servers(present, missing):
-- 
GitLab