[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feedback/todo on cback
On Thu, Oct 20, 2005 at 03:34:50PM -0500, Kenneth Pronovici wrote:
> > >>> There is not enought debug info and the programm run for hours
> > >>> without saying what is trying to do.
> > >>
> > >> Yeah, and then the last user who complained said that there was too much
> > >> in the debug log. :)
> >
> > >> It's a struggle to find a balance in the right level of logging, without
> > >> providing so much information that it's useless. Cedar Backup v1.0
> > >> listed every file it backed up, but that seemed excessive. Cedar Backup
> > >> v2.0 just logs information about individual collect directories, because
> > >> that's how I expected users to configure it.
> >
> > The user isn't expect to look into the log at debug level. At debug
> > level I expect all the info I can gather even at file level.
> > At info level information about individual collect directories is fine
> > with message like "computing hash for foo" or "collecting
> > exclusion/inclusion for foo" etc.
>
> I'll tell you what: I'll add a few extra log messages and send you a
> patch, and you can look and tell me what you think.
See if you like the behavior using the attached patch any better. When
using --debug, the log will now include information on every file and
every directory added to the list, and for incremental backups you'll
also see every SHA hash that's generated and every file that's discarded
from the list because it is unchanged.
Hopefully, this is more like what you were expecting. The result will
be big, but I guess you're right that if you specify --debug, you're
expecting rather verbose output. I think you'll see how there isn't
much middle ground between the output generated by 2.6.1 and the huge
amount of output this version will generate.
Apply the patch using:
tar -zxvf CedarBackup2-2.6.1.tar.gz
cd CedarBackup2-2.6.1
patch -p1 < /path/to/logging.patch
I'm open to suggestions on how to tweak this further, or how to tweak
what is logged using --verbose versus --debug.
KEN
--
Kenneth J. Pronovici <pronovic@ieee.org>
http://www.cedar-solutions.com/
diff -Naur CedarBackup2-2.6.1/CedarBackup2/filesystem.py CedarBackup2-2.6.1.new/CedarBackup2/filesystem.py
--- CedarBackup2-2.6.1/CedarBackup2/filesystem.py 2005-09-12 14:28:22.000000000 -0500
+++ CedarBackup2-2.6.1.new/CedarBackup2/filesystem.py 2005-10-20 17:54:35.351644672 -0500
@@ -282,6 +282,7 @@
logger.debug("Path [%s] is excluded based on pattern [%s]." % (path, pattern))
return 0
self.append(path)
+ logger.debug("Added file [%s] to list." % path)
return 1
def addDir(self, path):
@@ -320,6 +321,7 @@
logger.debug("Path [%s] is excluded based on pattern [%s]." % (path, pattern))
return 0
self.append(path)
+ logger.debug("Added directory [%s] to list." % path)
return 1
def addDirContents(self, path):
@@ -771,7 +773,9 @@
s.update(readString)
readBytes = len(readString)
f.close()
- return s.hexdigest()
+ digest = s.hexdigest()
+ logger.debug("Generated digest [%s] for file [%s]." % (digest, path))
+ return digest
_generateDigest = staticmethod(_generateDigest)
def generateFitted(self, capacity, algorithm="worst_fit"):
@@ -933,6 +937,7 @@
if digest == digestMap[entry]:
removed += 1
del table[entry]
+ logger.debug("Discarded unchanged file [%s]." % entry)
self[:] = table.keys()
return removed