X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethod.py;h=71977e60779ad7f268729c37e6b1893d20d03336;hb=b3c3e1029ce254558c7135ef114f72c986093aad;hp=74dc86211b1094c87605e12908a026dbaf86f0b5;hpb=e82add726b8532a9f61ce2260ff398e426fc342c;p=plcapi.git diff --git a/PLC/Method.py b/PLC/Method.py index 74dc8621..71977e60 100644 --- a/PLC/Method.py +++ b/PLC/Method.py @@ -91,7 +91,7 @@ class Method: result = self.call(*args, **kwds) runtime = time.time() - start - + if self.api.config.PLC_API_DEBUG or hasattr(self, 'message'): self.log(None, runtime, *args) @@ -108,8 +108,11 @@ class Method: # Prepend caller and method name to expected faults fault.faultString = caller + ": " + self.name + ": " + fault.faultString runtime = time.time() - start - self.log(fault, runtime, *args) - raise fault + + if self.api.config.PLC_API_DEBUG: + self.log(fault, runtime, *args) + + raise fault def log(self, fault, runtime, *args): """