]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
offloaded.py: fix logging a bit
authorBrian Warner <warner@allmydata.com>
Thu, 31 Jan 2008 20:45:01 +0000 (13:45 -0700)
committerBrian Warner <warner@allmydata.com>
Thu, 31 Jan 2008 20:45:01 +0000 (13:45 -0700)
src/allmydata/offloaded.py

index 2a5f6bfbb7dab573a2a814b5744eb4c8dc5b5e6b..6e61087cbbd5ad57d3f017b997bc293254d0ed53 100644 (file)
@@ -463,11 +463,13 @@ class Helper(Referenceable, service.MultiService):
         d = self._check_for_chk_already_in_grid(storage_index, lp)
         def _checked(upload_results):
             if upload_results:
+                self.log("file already found in grid", parent=lp)
                 return (upload_results, None)
 
             # the file is not present in the grid, by which we mean there are
             # less than 'N' shares available.
-            self.log("unable to find file in the grid", level=log.NOISY)
+            self.log("unable to find file in the grid", parent=lp,
+                     level=log.NOISY)
             # We need an upload helper. Check our active uploads again in
             # case there was a race.
             if storage_index in self._active_uploads:
@@ -481,6 +483,11 @@ class Helper(Referenceable, service.MultiService):
                 self._active_uploads[storage_index] = uh
             return uh.start()
         d.addCallback(_checked)
+        def _err(f):
+            self.log("error while checking for chk-already-in-grid",
+                     failure=f, level=log.WEIRD, parent=lp)
+            return f
+        d.addErrback(_err)
         return d
 
     def _check_for_chk_already_in_grid(self, storage_index, lp):