From: Brian Warner Date: Mon, 4 Dec 2006 07:46:36 +0000 (-0700) Subject: add some vdrive logging X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~471 X-Git-Url: https://git.rkrishnan.org/simplejson/quickstart.html?a=commitdiff_plain;h=e8806609608f22a80c6e9e0387ef099c0855ce4e;p=tahoe-lafs%2Ftahoe-lafs.git add some vdrive logging --- diff --git a/allmydata/vdrive.py b/allmydata/vdrive.py index d61251bd..a676bb42 100644 --- a/allmydata/vdrive.py +++ b/allmydata/vdrive.py @@ -3,6 +3,7 @@ from twisted.application import service from twisted.internet import defer +from twisted.python import log from allmydata import upload, download class VDrive(service.MultiService): @@ -78,6 +79,7 @@ class VDrive(service.MultiService): I return a deferred that will fire when the operation is complete. """ + log.msg("putting file to '%s'" % name) ul = self.parent.getServiceNamed("uploader") d = self.dirpath(dir_or_path) def _got_dir(dirnode): @@ -86,6 +88,10 @@ class VDrive(service.MultiService): dirnode.callRemote("add_file", name, vid)) return d1 d.addCallback(_got_dir) + def _done(res): + log.msg("finished putting file to '%s'" % name) + return res + d.addCallback(_done) return d def put_file_by_filename(self, dir_or_path, name, filename): @@ -112,6 +118,7 @@ class VDrive(service.MultiService): allmydata.download.Data, .FileName, or .FileHandle . """ + log.msg("getting file from %s" % (dir_and_name_or_path,)) dl = self.parent.getServiceNamed("downloader") if isinstance(dir_and_name_or_path, tuple): @@ -137,6 +144,10 @@ class VDrive(service.MultiService): def _got_verifierid(verifierid): return dl.download(verifierid, download_target) d.addCallback(_got_verifierid) + def _done(res): + log.msg("finished getting file") + return res + d.addCallback(_done) return d def get_file_to_filename(self, from_where, filename):