From: Tony Mack Date: Fri, 30 May 2008 18:16:47 +0000 (+0000) Subject: only log errors if logging is enabled X-Git-Tag: PLCAPI-4.3-1~37 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b3c3e1029ce254558c7135ef114f72c986093aad;p=plcapi.git only log errors if logging is enabled --- diff --git a/PLC/Method.py b/PLC/Method.py index 74dc862..71977e6 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): """