From: Thomas Markwalder Date: Wed, 16 May 2018 11:27:01 +0000 (-0400) Subject: [5589] Addressed more review comments X-Git-Tag: trac5549a_base~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71131063fd0eed2967348ffa911eea51cf6ea49d;p=thirdparty%2Fkea.git [5589] Addressed more review comments doc/guide/hooks-stat-cmds.xml Fixed return values doc/guide/logging.xml Added entry for kea-dhcp6.stat-cmds-hooks logger src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc Removed extra _CMDS from logger IDs src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc Removed extraneous using statement; --- diff --git a/doc/guide/hooks-stat-cmds.xml b/doc/guide/hooks-stat-cmds.xml index 8f2cdff98e..2201b640c5 100644 --- a/doc/guide/hooks-stat-cmds.xml +++ b/doc/guide/hooks-stat-cmds.xml @@ -80,7 +80,7 @@ subnet-id - ID of the subnet for which lease statistics should be fetched. Use this to get statistics for a single subnet. If the subnet does not exist the command result - code will be 2 (i.e. CONTROL_RESULT_EMPTY). + code will be 3 (i.e. CONTROL_RESULT_EMPTY). @@ -89,7 +89,7 @@ be retrieved. Note that fuzzy values are supported thus allowing for a query for statistics using approximate ID values. If the range does not include any known subnets, the command result code - will be 2 (i.e. CONTROL_RESULT_EMPTY). + will be 3 (i.e. CONTROL_RESULT_EMPTY). first-subnet-id - ID of the first diff --git a/doc/guide/logging.xml b/doc/guide/logging.xml index a9f41e4a70..e92009f9a9 100644 --- a/doc/guide/logging.xml +++ b/doc/guide/logging.xml @@ -315,10 +315,10 @@ - kea-dhcp4.stat-cmds-hooks - this logger is used - to log messages related to operation of the Stats Cmds hooks library. - In general these will pertain to loading and unloading the library, - as well as execution of commands by the library. + kea-dhcp4.stat-cmds-hooks - this logger is + used to log messages related to operation of the Stats Cmds hooks + library. In general these will pertain to loading and unloading + the library and the execution of commands by the library. @@ -446,6 +446,15 @@ + + + kea-dhcp6.stat-cmds-hooks - this logger is + used to log messages related to operation of the Stats Cmds hooks + library. In general these will pertain to loading and unloading + the library and the execution of commands by the library. + + + kea-dhcp-ddns - the root logger for the diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc b/src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc index a0da474396..768ff05d00 100644 --- a/src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc +++ b/src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc @@ -47,7 +47,7 @@ int stat_lease6_get(CalloutHandle& handle) { int load(LibraryHandle& handle) { handle.registerCommandCallout("stat-lease4-get", stat_lease4_get); handle.registerCommandCallout("stat-lease6-get", stat_lease6_get); - LOG_INFO(stat_cmds_logger, STAT_CMDS_CMDS_INIT_OK); + LOG_INFO(stat_cmds_logger, STAT_CMDS_INIT_OK); return (0); } @@ -55,7 +55,7 @@ int load(LibraryHandle& handle) { /// /// @return 0 if deregistration was successful, 1 otherwise int unload() { - LOG_INFO(stat_cmds_logger, STAT_CMDS_CMDS_DEINIT_OK); + LOG_INFO(stat_cmds_logger, STAT_CMDS_DEINIT_OK); return (0); } diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes b/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes index 636262a2c0..7b5083349e 100644 --- a/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes +++ b/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes @@ -34,20 +34,20 @@ The parameters submitted with stat-lease6-get were valid but excluded all known subnets. The parameters supplied along with an explanation should be logged. -% STAT_CMDS_CMDS_DEINIT_FAILED unloading Stat Commands hooks library failed: %1 +% STAT_CMDS_DEINIT_FAILED unloading Stat Commands hooks library failed: %1 This error message indicates an error during unloading the Lease Commands hooks library. The details of the error are provided as argument of the log message. -% STAT_CMDS_CMDS_DEINIT_OK unloading Stat Commands hooks library successful +% STAT_CMDS_DEINIT_OK unloading Stat Commands hooks library successful This info message indicates that the Stat Commands hooks library has been removed successfully. -% STAT_CMDS_CMDS_INIT_FAILED loading Stat Commands hooks library failed: %1 +% STAT_CMDS_INIT_FAILED loading Stat Commands hooks library failed: %1 This error message indicates an error during loading the Lease Commands hooks library. The details of the error are provided as argument of the log message. -% STAT_CMDS_CMDS_INIT_OK loading Stat Commands hooks library successful +% STAT_CMDS_INIT_OK loading Stat Commands hooks library successful This info message indicates that the Stat Commands hooks library has been loaded successfully. Enjoy! diff --git a/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc b/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc index c09ac0c871..4e8a8a0489 100644 --- a/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc +++ b/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc @@ -591,8 +591,6 @@ TEST_F(StatCmdsTest, multipleLoads) { testMultipleLoads(); } -using namespace isc::dhcp; - struct TestScenario { std::string description_; std::string command_txt_;