add omf log dir in spec and stop logging api method calls (but only xmpp messages)
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Fri, 19 Mar 2010 14:35:54 +0000 (14:35 +0000)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Fri, 19 Mar 2010 14:35:54 +0000 (14:35 +0000)
PLCAPI.spec
aspects/omfaspects.py

index 22279ae..9bdcd8b 100644 (file)
@@ -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 <thierry.parmentelat@sophia.inria.fr> - PLCAPI-5.0-4
 - do not use UpdateNode for handling the 'hrn' tag - should fix refresh peer & foreign nodes more generally
index 9b95860..e2fd884 100644 (file)
@@ -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)