BIND 10 #2978: Use DHCPDDNS_XXX as prefix for D2 log messages.

BIND 10 Development do-not-reply at isc.org
Fri Jun 7 21:04:02 UTC 2013


#2978: Use DHCPDDNS_XXX as prefix for D2 log messages.
-------------------------------------+-------------------------------------
            Reporter:  tmark         |                        Owner:
                Type:  defect        |  UnAssigned
            Priority:  medium        |                       Status:
           Component:  dhcp          |  reviewing
            Keywords:                |                    Milestone:
           Sensitive:  0             |  Sprint-DHCP-20130606
         Sub-Project:  DHCP          |                   Resolution:
Estimated Difficulty:  0             |                 CVSS Scoring:
         Total Hours:  0             |              Defect Severity:  N/A
                                     |  Feature Depending on Ticket:
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
Changes (by tmark):

 * owner:  tmark => UnAssigned
 * status:  accepted => reviewing


Comment:

 What started out as a rather simple ticket, turned out to be a bit more
 work
 but the result is much better.  Since the base classes are intended to be
 reused, for other modules, log statements emanating from them should not
 be
 hard-coded to refer to DHCP-DDNS.  So I split the messages logically
 (they're
 still in one .mes file) into those emanating from the base, and those
 emanating
 from DHCP-DDNS derivation.  Those from the base are prefixed now with
 DCTL_,
 those from the derivation are prefixed with DHCP_DDNS_.

 Going a step further, I renamed the name_ members of DControllerBase and
 DProcessBase to be app_name_. This value is displayed in base class log
 statements.  I added a second member to DControllerBase, bin_name_.  This
 is
 the executable or module name. This value is what is used to initialize
 the
 logger.  In this manner each derivation supplies its own names for use in
 the
 base class logging.


 For D2, these values are:

 /// @brief Defines the application name, this is passed into base class
 /// and appears in log statements.
 const char* D2Controller::d2_app_name_ = "Dhcp-Ddns";

 /// @brief Defines the executable name. This is passed into the base class
 /// by convention this should match the BIND10 module name.
 const char* D2Controller::d2_bin_name_ = "b10-dhcp-ddns";

 Lastly, I changed the logger name from "d2_logger" to "dctl".

 What follows is an excerpt from BIND10's log so you can see the net
 affect:

 {{{
 2013-06-07 16:06:03.452 DEBUG [b10-init.init/84985]
 BIND10_STARTED_PROCESS_PID started b10-dhcp-ddns (PID 84990)
 2013-06-07 16:06:03.460 DEBUG [b10-dhcp-ddns.dctl/84990] DCTL_STARTING
 Dhcp-Ddns controller starting, pid: 84990
 2013-06-07 16:06:03.460 DEBUG [b10-dhcp-ddns.dctl/84990] DCTL_INIT_PROCESS
 Dhcp-Ddns initializing the application
 2013-06-07 16:06:03.461 DEBUG [b10-dhcp-ddns.dctl/84990] DCTL_CONFIG_STUB
 Dhcp-Ddns configuration stub handler called
 2013-06-07 16:06:03.461 DEBUG [b10-dhcp-ddns.config/84990]
 CONFIG_LOG_WILD_MATCH will use logging configuration for wildcard logger *
 2013-06-07 16:06:03.461 DEBUG [b10-dhcp-ddns.dctl/84990]
 DCTL_CONFIG_UPDATE Dhcp-Ddns updated configuration received: { "spiffy":
 "wahoo" }
 2013-06-07 16:06:03.461 DEBUG [b10-dhcp-ddns.dctl/84990]
 DHCP_DDNS_CONFIGURE configuration update received: { "spiffy": "wahoo" }
 2013-06-07 16:06:03.462 DEBUG [b10-dhcp-ddns.dctl/84990] DCTL_RUN_PROCESS
 Dhcp-Ddns starting application event loop
 2013-06-07 16:06:03.462 DEBUG [b10-dhcp-ddns.dctl/84990]
 DHCP_DDNS_RUN_ENTER application has entered the event loop
 2013-06-07 16:07:19.453 DEBUG [b10-dhcp-ddns.dctl/84990]
 DCTL_CONFIG_UPDATE Dhcp-Ddns updated configuration received: { "spiffy":
 "you betcha" }
 2013-06-07 16:07:19.453 DEBUG [b10-dhcp-ddns.dctl/84990]
 DHCP_DDNS_CONFIGURE configuration update received: { "spiffy": "you
 betcha" }
 2013-06-07 16:07:34.212 DEBUG [b10-dhcp-ddns.dctl/84990]
 DCTL_COMMAND_RECEIVED Dhcp-Ddns received command status, arguments: {  }
 2013-06-07 16:07:34.213 DEBUG [b10-dhcp-ddns.dctl/84990] DHCP_DDNS_COMMAND
 command directive received, command: status - args: {  }
 2013-06-07 16:07:47.853 DEBUG [b10-dhcp-ddns.dctl/84990]
 DCTL_COMMAND_RECEIVED Dhcp-Ddns received command shutdown, arguments: {  }
 2013-06-07 16:07:47.853 DEBUG [b10-dhcp-ddns.dctl/84990]
 DHCP_DDNS_SHUTDOWN application is performing a normal shut down
 2013-06-07 16:07:47.853 DEBUG [b10-dhcp-ddns.dctl/84990]
 DHCP_DDNS_RUN_EXIT application is exiting the event loop
 2013-06-07 16:07:47.854 INFO  [b10-dhcp-ddns.dctl/84990] DCTL_STOPPING
 Dhcp-Ddns controller is exiting
 2013-06-07 16:07:47.854 INFO  [b10-init.init/84985] BIND10_PROCESS_ENDED
 process 84990 of b10-dhcp-ddns ended with status 0
 2013-06-07 16:07:47.854 ERROR [b10-init.init/84985]
 BIND10_COMPONENT_FAILED component b10-dhcp-ddns (pid 84990) failed:
 process e
 }}}

-- 
Ticket URL: <http://bind10.isc.org/ticket/2978#comment:3>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list