mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-22 20:38:18 +00:00
immutable/checker: make log() tolerate the format= form
This commit is contained in:
parent
3408d552cd
commit
af2231563e
@ -165,12 +165,19 @@ class SimpleCHKFileVerifier(download.FileDownloader):
|
|||||||
num = self._client.log("SimpleCHKFileVerifier(%s): starting" % prefix)
|
num = self._client.log("SimpleCHKFileVerifier(%s): starting" % prefix)
|
||||||
self._log_number = num
|
self._log_number = num
|
||||||
|
|
||||||
def log(self, msg, *args, **kwargs):
|
def log(self, *args, **kwargs):
|
||||||
if not kwargs.get('parent'):
|
if not "parent" in kwargs:
|
||||||
kwargs['parent'] = self._log_number
|
kwargs['parent'] = self._log_number
|
||||||
return self._client.log("SimpleCHKFileVerifier(%s): %s"
|
# add a prefix to the message, regardless of how it is expressed
|
||||||
% (self._log_prefix, msg),
|
prefix = "SimpleCHKFileVerifier(%s): " % self._log_prefix
|
||||||
*args, **kwargs)
|
if "format" in kwargs:
|
||||||
|
kwargs["format"] = prefix + kwargs["format"]
|
||||||
|
elif "message" in kwargs:
|
||||||
|
kwargs["message"] = prefix + kwargs["message"]
|
||||||
|
elif args:
|
||||||
|
m = prefix + args[0]
|
||||||
|
args = (m,) + args[1:]
|
||||||
|
return self._client.log(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user