git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
only log errors if logging is enabled
[plcapi.git]
/
PLC
/
Method.py
diff --git
a/PLC/Method.py
b/PLC/Method.py
index
74dc862
..
71977e6
100644
(file)
--- a/
PLC/Method.py
+++ b/
PLC/Method.py
@@
-91,7
+91,7
@@
class Method:
result = self.call(*args, **kwds)
runtime = time.time() - start
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)
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
# 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):
"""
def log(self, fault, runtime, *args):
"""