]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
logging: better log message when a new file is identified 56/head
authorJason Ish <ish@unx.ca>
Tue, 30 Oct 2018 19:54:36 +0000 (13:54 -0600)
committerJason Ish <ish@unx.ca>
Wed, 31 Oct 2018 22:43:05 +0000 (16:43 -0600)
instead of saying "recording <file> with hash ''" where the
hash is empty, log that a new file is being recorded

No functional change outside of the log message.

suricata/update/main.py

index d9b372869ff08da2f62daf907fc2563ddc11e71f..8c1c9297bb804cb41357bb1567d9439bcdfcdec2 100644 (file)
@@ -785,7 +785,11 @@ class FileTracker:
 
     def add(self, filename):
         checksum = self.md5(filename)
-        logger.debug("Recording file %s with hash '%s'.", filename, checksum)
+        if not checksum:
+            logger.debug("Recording new file %s" % (filename))
+        else:
+            logger.debug("Recording existing file %s with hash '%s'.",
+                filename, checksum)
         self.hashes[filename] = checksum
 
     def md5(self, filename):