From 313a1747bd361ab42351a65b3c80da42c506c7d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 19 Mar 2010 14:35:54 +0000 Subject: [PATCH] add omf log dir in spec and stop logging api method calls (but only xmpp messages) --- PLCAPI.spec | 2 ++ aspects/omfaspects.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/PLCAPI.spec b/PLCAPI.spec index 22279ae9..9bdcd8ba 100644 --- a/PLCAPI.spec +++ b/PLCAPI.spec @@ -121,6 +121,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %dir %{_datadir}/plc_api +%dir /var/log/omf/ %{_datadir}/plc_api/* %{_bindir}/plcsh %{php_extension_dir}/xmlrpc.so @@ -132,6 +133,7 @@ rm -rf $RPM_BUILD_ROOT /usr/bin/omf_slicemgr.py* /usr/bin/reset_xmpp_pubsub_nodes.py* + %changelog * Sun Mar 14 2010 Thierry Parmentelat - PLCAPI-5.0-4 - do not use UpdateNode for handling the 'hrn' tag - should fix refresh peer & foreign nodes more generally diff --git a/aspects/omfaspects.py b/aspects/omfaspects.py index 9b958600..e2fd8845 100644 --- a/aspects/omfaspects.py +++ b/aspects/omfaspects.py @@ -14,9 +14,14 @@ class BaseOMF(object): def __init__(self): self.config = Config("/etc/planetlab/plc_config") - self.log = open("/var/log/omf/plc_slice_calls.log", "a") + # this was only for debugging, no need to log all method calls here -baris + # self.log = open("/var/log/omf/plc_slice_calls.log", "a") + self.log = None + def logit(self, call, args, kwargs, data, slice): + if not self.log: return + self.log.write("%s : args: %s kwargs: %s\n" % (call, args, kwargs)) self.log.write("data: %s\n" % data) self.log.write("%s\n\n" % slice) -- 2.47.0