diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index b17f6bbbf..bc3a11572 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -86,10 +86,10 @@ class MagicFolder(service.MultiService): self.set_public_status) self._public_status = (False, ['Magic folder has not yet started']) - def enable_debug_log(self): + def enable_debug_log(self, enabled=True): print "enable debug log" - self.uploader.enable_debug_log() - self.downloader.enable_debug_log() + self.uploader.enable_debug_log(enabled) + self.downloader.enable_debug_log(enabled) def get_public_status(self): """ @@ -172,9 +172,9 @@ class QueueMixin(HookMixin): # far) self._processing = defer.succeed(None) - def enable_debug_log(self): + def enable_debug_log(self, enabled=True): print "queue mixin enable debug logging" - self._debug_log = True + self._debug_log = enabled def get_status(self): """ diff --git a/src/allmydata/test/test_magic_folder.py b/src/allmydata/test/test_magic_folder.py index 8a9ea4c00..94f3f863c 100644 --- a/src/allmydata/test/test_magic_folder.py +++ b/src/allmydata/test/test_magic_folder.py @@ -1032,6 +1032,11 @@ class SingleMagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, Reall def tearDown(self): d = super(SingleMagicFolderTestMixin, self).tearDown() + def _disable_debugging(res): + if self.magicfolder: + self.magicfolder.enable_debug_log(False) + return res + d.addBoth(_disable_debugging) d.addCallback(self.cleanup) return d