adding more easy to understand diff backup debug output
authorEduardo Robles Elvira <edulix@wadobo.com>
Tue, 11 Mar 2014 12:27:10 +0000 (13:27 +0100)
committerEduardo Robles Elvira <edulix@wadobo.com>
Tue, 11 Mar 2014 12:27:10 +0000 (13:27 +0100)
deltatar/deltatar.py

index 309427a..e01ccf6 100644 (file)
@@ -824,6 +824,8 @@ class DeltaTar(object):
                 stat['path'] = "snapshot://" + dpath['path']
                 stat['volume'] = self.vol_no
 
+                self.logger.debug("[STORE] %s" % dpath['path'])
+
                 # backup file
                 tarobj.add(dpath['path'], arcname=stat['path'], recursive=False)
 
@@ -835,10 +837,12 @@ class DeltaTar(object):
                 crc = binascii.crc32(s, crc) & 0xffffffff
                 index_fd.write(s)
             elif action == 'delete':
+                path = self.unprefixed(ipath['path'])
                 stat = {
-                    u'path': u'delete://' + self.unprefixed(ipath['path']),
+                    u'path': u'delete://' + path,
                     u'type': ipath['type']
                 }
+                self.logger.debug("[DELETE] %s" % path)
 
                 # mark it as deleted in the backup
                 tarobj.add("/dev/null", arcname=stat['path'])
@@ -849,14 +853,15 @@ class DeltaTar(object):
                 index_fd.write(s)
             elif action == 'list':
                 stat = dpath.copy()
-                stat['path'] = u'list://' + self.unprefixed(ipath['path'])
+                path = self.unprefixed(ipath['path'])
+                stat['path'] = u'list://' + path
                 # unchanged files do not enter in the backup, only in the index
+                self.logger.debug("[UNCHANGED] %s" % path)
 
                 # store in the index the stat dict
                 s = bytes(json.dumps(stat) + '\n', 'UTF-8')
                 crc = binascii.crc32(s, crc) & 0xffffffff
                 index_fd.write(s)
-            self.logger.debug("backup %s" % stat['path'])
 
         s = bytes('{"type": "END-FILE-LIST"}\n', 'UTF-8')
         crc = binascii.crc32(s, crc) & 0xffffffff