From b3c3e1029ce254558c7135ef114f72c986093aad Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Fri, 30 May 2008 18:16:47 +0000 Subject: [PATCH] only log errors if logging is enabled --- PLC/Method.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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): """ -- 2.43.0