Ficus
  • Overview
  • Repository
  • Tickets
  • Statistics
  • Projects

Repository

Improve logging

Parent commits : 685d7024340a21f713c8bb8f40efd9329ac280d0,
Children commits : 3293dd2354532d1022ec7331c6c89287633db1b3,

By Laurent Defert on 2012-10-16 17:31:48
Improve logging

Browse content
Difference with parent commit 685d7024340a21f713c8bb8f40efd9329ac280d0
Files modified:
bin/ficus_mount.in
--- 
+++ 
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 import errno
+import logging
 from Queue import Queue
 
 import fuse
@@ -9,6 +10,9 @@
 fuse.fuse_python_api = (0, 2)
 
 CLIENT_COUNT = 16
+
+FORMAT='[%(process)d] %(message)s'
+logging.basicConfig(level=logging.DEBUG, format=FORMAT)
 
 def dirFromList(list):
     """
@@ -74,14 +78,14 @@
             return -e.errno
         except Exception, e:
             self.clients.put(client)
-            print 'Caught exception:', e
+            logging.exception('Caught exception')
             return -errno.EFAULT
 
 
         self.clients.put(client)
         print "remainging client:", self.clients.qsize()
         args_str = ','.join([repr(a) for a in args])
-        print "returning: %s(%s) -> %s" % (method_name, args_str, str(ret))
+        print "returning: %s(%s) -> %s" % (method_name, args_str, repr(ret))
         return ret
 
 if __name__ == '__main__':

Generated with KisssPM