Browse Source

[2582] Logging of msgq configuration

Michal 'vorner' Vaner 12 years ago
parent
commit
2f3611a364
2 changed files with 18 additions and 0 deletions
  1. 7 0
      src/bin/msgq/msgq.py.in
  2. 11 0
      src/bin/msgq/msgq_messages.mes

+ 7 - 0
src/bin/msgq/msgq.py.in

@@ -657,22 +657,29 @@ class MsgQ:
         """The configuration handler (run in a separate thread).
            Not tested, currently effectively empty.
         """
+        config_logger.debug(TRACE_DETAIL, MSGQ_CONFIG_DATA, new_config)
+
         with self.__lock:
             if not self.running:
                 return
 
             # TODO: Any config handlig goes here.
+
             return isc.config.create_answer(0)
 
     def command_handler(self, command, args):
         """The command handler (run in a separate thread).
            Not tested, currently effectively empty.
         """
+        config_logger.debug(TRACE_DETAIL, MSGQ_COMMAND, command, args)
+
         with self.__lock:
             if not self.running:
                 return
 
             # TODO: Any commands go here
+
+            config_logger.error(MSGQ_COMMAND_UNKNOWN, command)
             return isc.config.create_answer(1, 'unknown command: ' + command)
 
 def signal_handler(msgq, signal, frame):

+ 11 - 0
src/bin/msgq/msgq_messages.mes

@@ -23,6 +23,17 @@
 This is a debug message. The message queue has little bit of special handling
 for the configuration manager. This special handling is happening now.
 
+% MSGQ_COMMAND Running command %1 with arguments %2
+Debug message. The message queue received a command and it is running it.
+
+% MSGQ_COMMAND_UNKNOWN Unknown command '%1'
+The message queue received a command from other module, but it doesn't
+recognize it. This is probably either a coding error or inconsistency between
+the message queue version and version of the module.
+
+% MSGQ_CONFIG_DATA Received configuration for the msgq: %1
+Debug message. The message queue received a configuration, handling it.
+
 % MSGQ_HDR_DECODE_ERR Error decoding header received from socket %1: %2
 The socket with mentioned file descriptor sent a packet. However, it was not
 possible to decode the routing header of the packet. The packet is ignored.