From: Tomek Mrugalski Date: Thu, 6 Sep 2018 13:40:43 +0000 (+0200) Subject: [#25,!14] Removed setVerbose() from CfgMgr (now available in Daemon) X-Git-Tag: gitlab116_base~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a5b5caaaa6f1249189e6c590834a078be5c0a67;p=thirdparty%2Fkea.git [#25,!14] Removed setVerbose() from CfgMgr (now available in Daemon) --- diff --git a/src/lib/dhcpsrv/cfgmgr.cc b/src/lib/dhcpsrv/cfgmgr.cc index 2896b8bc4a..813895f239 100644 --- a/src/lib/dhcpsrv/cfgmgr.cc +++ b/src/lib/dhcpsrv/cfgmgr.cc @@ -167,8 +167,7 @@ CfgMgr::getStagingCfg() { } CfgMgr::CfgMgr() - : datadir_(DHCP_DATA_DIR), d2_client_mgr_(), - verbose_mode_(false), family_(AF_INET) { + : datadir_(DHCP_DATA_DIR), d2_client_mgr_(), family_(AF_INET) { // DHCP_DATA_DIR must be set set with -DDHCP_DATA_DIR="..." in Makefile.am // Note: the definition of DHCP_DATA_DIR needs to include quotation marks // See AM_CPPFLAGS definition in Makefile.am diff --git a/src/lib/dhcpsrv/cfgmgr.h b/src/lib/dhcpsrv/cfgmgr.h index 2afccb15b8..ad0e8a606e 100644 --- a/src/lib/dhcpsrv/cfgmgr.h +++ b/src/lib/dhcpsrv/cfgmgr.h @@ -233,37 +233,6 @@ public: //@} - /// @name Methods setting/accessing global configuration for the process. - /// - //@{ - /// @brief Sets verbose mode. - /// - /// @param verbose A boolean value indicating if the process should run - /// in verbose (true) or non-verbose mode. - void setVerbose(const bool verbose) { - verbose_mode_ = verbose; - } - - /// @brief Checks if the process has been run in verbose mode. - /// - /// @return true if verbose mode enabled, false otherwise. - bool isVerbose() const { - return (verbose_mode_); - } - - /// @brief Sets the default logger name. - /// - /// This name is used in cases when a user doesn't provide a configuration - /// for logger in the Kea configuration file. - void setDefaultLoggerName(const std::string& name) { - default_logger_name_ = name; - } - - /// @brief Returns default logger name. - std::string getDefaultLoggerName() const { - return (default_logger_name_); - } - /// @brief Sets address family (AF_INET or AF_INET6) void setFamily(uint16_t family) { family_ = family == AF_INET ? AF_INET : AF_INET6; @@ -320,12 +289,6 @@ private: SrvConfigList configs_; //@} - /// @brief Indicates if a process has been ran in the verbose mode. - bool verbose_mode_; - - /// @brief Default logger name. - std::string default_logger_name_; - /// @brief Address family. uint16_t family_; }; diff --git a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc index ba62eb56ed..96a87821c8 100644 --- a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc @@ -281,7 +281,6 @@ public: } void clear() { - CfgMgr::instance().setVerbose(false); CfgMgr::instance().setFamily(AF_INET); CfgMgr::instance().clear(); LeaseMgrFactory::destroy(); @@ -496,18 +495,6 @@ TEST_F(CfgMgrTest, revert) { EXPECT_EQ(12, cfg_mgr.getCurrentCfg()->getLoggingInfo()[0].debuglevel_); } -// This test verifies that the verbosity can be set and obtained from the -// configuration manager. -TEST_F(CfgMgrTest, verbosity) { - ASSERT_FALSE(CfgMgr::instance().isVerbose()); - - CfgMgr::instance().setVerbose(true); - ASSERT_TRUE(CfgMgr::instance().isVerbose()); - - CfgMgr::instance().setVerbose(false); - EXPECT_FALSE(CfgMgr::instance().isVerbose()); -} - // This test verifies that the address family can be set and obtained // from the configuration manager. TEST_F(CfgMgrTest, family) {