[IMP] Shutdown all handlers of the logger
authorStephane Wirtel <stephane@tinyerp.com>
Tue, 30 Dec 2008 17:58:25 +0000 (18:58 +0100)
committerStephane Wirtel <stephane@tinyerp.com>
Tue, 30 Dec 2008 17:58:25 +0000 (18:58 +0100)
bzr revid: stephane@tinyerp.com-20081230175825-tp4zb02tj7py0pb4

bin/netsvc.py
bin/openerp-server.py

index e3980b2..1d5a3e5 100644 (file)
@@ -137,7 +137,7 @@ class LocalService(Service):
             raise
 
 def service_exist(name):
-    return (name in _service) and bool(_service[name])
+    return _service.get(name, False)
 
 LOG_NOTSET = 'notset'
 LOG_DEBUG_RPC = 'debug_rpc'
@@ -230,6 +230,9 @@ class Logger(object):
         elif result:
             level_method(result[0])
 
+    def shutdown(self):
+        logging.shutdown()
+
 import tools
 init_logger()
 
index 8065f1f..6731e36 100755 (executable)
@@ -189,6 +189,7 @@ def handler(signum, _):
         os.unlink(tools.config['pidfile'])
     logger.notifyChannel('shutdown', netsvc.LOG_INFO, 
                          "Shutdown Server! - %s" % ( SIGNALS[signum], ))
+    logger.shutdown()
     sys.exit(0)
 
 for signum in SIGNALS: