浏览代码

""" I'll make one called BLAT (blather) below TRAC and move all the
current TRAC logging calls to that. Currently RPC metainfo is
logged at DEBG, I'll move that to to TRAC. The only things that
will log at BLAT will be supervisor internal, not including the
builtin RPC interfaces. This should make DEBG mostly (if not
exclusively) about child process output then. """

Chris McDonough 18 年之前
父节点
当前提交
cb059aaa0a
共有 6 个文件被更改,包括 12 次插入21 次删除
  1. 0 9
      TODO.txt
  2. 1 1
      src/supervisor/http.py
  3. 2 2
      src/supervisor/options.py
  4. 5 5
      src/supervisor/supervisord.py
  5. 1 1
      src/supervisor/tests/base.py
  6. 3 3
      src/supervisor/xmlrpc.py

+ 0 - 9
TODO.txt

@@ -28,15 +28,6 @@
 - Make *:9001 work for port num (see
   http://www.plope.com/software/collector/247)
 
-- Inject BLATHER log level (from list):
-
-  """ I'll make one called BLAT (blather) below TRAC and move all the
-  current TRAC logging calls to that.  Currently RPC metainfo is
-  logged at DEBG, I'll move that to to TRAC.  The only things that
-  will log at BLAT will be supervisor internal, not including the
-  builtin RPC interfaces.  This should make DEBG mostly (if not
-  exclusively) about child process output then. """
-
 - Generalize eventlistener request/response protocol (wrap OK/FAIL in
   RESULT envelope) so we can use it for more specialized
   communications, e.g.:

+ 1 - 1
src/supervisor/http.py

@@ -771,7 +771,7 @@ def make_http_server(options, supervisord):
         def log(self, msg):
             if msg.endswith('\n'):
                 msg = msg[:-1]
-            options.logger.debug(msg)
+            options.logger.trace(msg)
     wrapper = LogWrapper()
 
     family = options.http_port.family

+ 2 - 2
src/supervisor/options.py

@@ -793,7 +793,7 @@ class ServerOptions(Options):
         pid = os.fork()
         if pid != 0:
             # Parent
-            self.logger.trace("supervisord forked; parent exiting")
+            self.logger.blather("supervisord forked; parent exiting")
             os._exit(0)
         # Child
         self.logger.info("daemonizing the supervisord process")
@@ -1005,7 +1005,7 @@ class ServerOptions(Options):
                 self.logger.critical(
                     'waitpid error; a process may not be cleaned up properly')
             if err == errno.EINTR:
-                self.logger.trace('EINTR during reap')
+                self.logger.blather('EINTR during reap')
             pid, sts = None, None
         return pid, sts
 

+ 5 - 5
src/supervisor/supervisord.py

@@ -139,7 +139,7 @@ class Supervisor:
                 self.lastdelayreport = now
                 for proc in delayprocs:
                     state = getProcessStateDescription(proc.get_state())
-                    self.options.logger.debug(
+                    self.options.logger.blather(
                         '%s state: %s' % (proc.config.name, state))
         return delayprocs
 
@@ -203,7 +203,7 @@ class Supervisor:
             except select.error, err:
                 r = w = x = []
                 if err[0] == errno.EINTR:
-                    self.options.logger.trace('EINTR encountered in select')
+                    self.options.logger.blather('EINTR encountered in select')
                 else:
                     raise
 
@@ -211,7 +211,7 @@ class Supervisor:
                 if combined_map.has_key(fd):
                     try:
                         dispatcher = combined_map[fd]
-                        self.options.logger.trace(
+                        self.options.logger.blather(
                             'read event caused by %(dispatcher)s',
                             dispatcher=dispatcher)
                         dispatcher.handle_read_event()
@@ -224,7 +224,7 @@ class Supervisor:
                 if combined_map.has_key(fd):
                     try:
                         dispatcher = combined_map[fd]
-                        self.options.logger.trace(
+                        self.options.logger.blather(
                             'write event caused by %(dispatcher)s',
                             dispatcher=dispatcher)
                         dispatcher.handle_write_event()
@@ -277,7 +277,7 @@ class Supervisor:
                 for group in self.process_groups.values():
                     group.reopenlogs()
             else:
-                self.options.logger.trace(
+                self.options.logger.blather(
                     'received %s indicating nothing' % signame(sig))
         
     def get_state(self):

+ 1 - 1
src/supervisor/tests/base.py

@@ -254,7 +254,7 @@ class DummyLogger:
         if kw:
             msg = msg % kw
         self.data.append(msg)
-    warn = debug = critical = trace = error = info
+    warn = debug = critical = trace = error = blather = info
 
     def log(self, level, msg, **kw):
         if kw:

+ 3 - 3
src/supervisor/xmlrpc.py

@@ -341,7 +341,7 @@ class supervisor_xmlrpc_handler(xmlrpc_handler):
             params, method = self.loads(data)
 
             try:
-                logger.debug('XML-RPC method called: %s()' % method)
+                logger.trace('XML-RPC method called: %s()' % method)
                 value = self.call(method, params)
                 # application-specific: instead of we never want to
                 # marshal None (even though we could by saying allow_none=True
@@ -351,12 +351,12 @@ class supervisor_xmlrpc_handler(xmlrpc_handler):
                     'return value from method %r with params %r is None' %
                     (method, params)
                     )
-                logger.debug('XML-RPC method %s() returned successfully' %
+                logger.trace('XML-RPC method %s() returned successfully' %
                              method)
             except RPCError, err:
                 # turn RPCError reported by method into a Fault instance
                 value = xmlrpclib.Fault(err.code, err.text)
-                logger.debug('XML-RPC method %s() returned fault: [%d] %s' % (
+                logger.trace('XML-RPC method %s() returned fault: [%d] %s' % (
                     method,
                     err.code, err.text))