From: Tomek Mrugalski Date: Wed, 6 Aug 2014 09:48:50 +0000 (+0200) Subject: [3417] B10 => KEA renamed X-Git-Tag: trac3482_base~55^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aba37777cafd71b331b60799d24ff3cec45c963a;p=thirdparty%2Fkea.git [3417] B10 => KEA renamed --- diff --git a/src/bin/d2/bundy_d2_controller.cc b/src/bin/d2/bundy_d2_controller.cc index 62b0746d18..ad37e44659 100644 --- a/src/bin/d2/bundy_d2_controller.cc +++ b/src/bin/d2/bundy_d2_controller.cc @@ -52,8 +52,8 @@ D2Controller::D2Controller() : DControllerBase(d2_app_name_, d2_bin_name_) { // set the spec file either from the environment or // use the production value. - if (getenv("B10_FROM_BUILD")) { - setSpecFileName(std::string(getenv("B10_FROM_BUILD")) + + if (getenv("KEA_FROM_BUILD")) { + setSpecFileName(std::string(getenv("KEA_FROM_BUILD")) + "/src/bin/d2/dhcp-ddns.spec"); } else { setSpecFileName(D2_SPECFILE_LOCATION); diff --git a/src/bin/d2/d2_controller.cc b/src/bin/d2/d2_controller.cc index 558aea6dde..4b61ad37eb 100644 --- a/src/bin/d2/d2_controller.cc +++ b/src/bin/d2/d2_controller.cc @@ -50,8 +50,8 @@ D2Controller::D2Controller() : DControllerBase(d2_app_name_, d2_bin_name_) { // set the spec file either from the environment or // use the production value. - if (getenv("B10_FROM_BUILD")) { - setSpecFileName(std::string(getenv("B10_FROM_BUILD")) + + if (getenv("KEA_FROM_BUILD")) { + setSpecFileName(std::string(getenv("KEA_FROM_BUILD")) + "/src/bin/d2/dhcp-ddns.spec"); } else { setSpecFileName(D2_SPECFILE_LOCATION); diff --git a/src/bin/d2/d_controller.cc b/src/bin/d2/d_controller.cc index 8bb4d185fd..06b39ed72c 100644 --- a/src/bin/d2/d_controller.cc +++ b/src/bin/d2/d_controller.cc @@ -402,11 +402,11 @@ DControllerBase::~DControllerBase() { // Provide an implementation until we figure out a better way to do this. void dhcp::Daemon::loggerInit(const char* log_name, bool verbose) { - setenv("B10_LOCKFILE_DIR_FROM_BUILD", "/tmp", 1); - setenv("B10_LOGGER_ROOT", log_name, 0); - setenv("B10_LOGGER_SEVERITY", (verbose ? "DEBUG":"INFO"), 0); - setenv("B10_LOGGER_DBGLEVEL", "99", 0); - setenv("B10_LOGGER_DESTINATION", "stdout", 0); + setenv("KEA_LOCKFILE_DIR_FROM_BUILD", "/tmp", 1); + setenv("KEA_LOGGER_ROOT", log_name, 0); + setenv("KEA_LOGGER_SEVERITY", (verbose ? "DEBUG":"INFO"), 0); + setenv("KEA_LOGGER_DBGLEVEL", "99", 0); + setenv("KEA_LOGGER_DESTINATION", "stdout", 0); isc::log::initLogger(); } diff --git a/src/bin/d2/tests/d2_unittests.cc b/src/bin/d2/tests/d2_unittests.cc index bfba3792ee..413abdf527 100644 --- a/src/bin/d2/tests/d2_unittests.cc +++ b/src/bin/d2/tests/d2_unittests.cc @@ -21,7 +21,7 @@ main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); - // See the documentation of the B10_* environment variables in + // See the documentation of the KEA_* environment variables in // src/lib/log/README for info on how to tweak logging isc::log::initLogger(); diff --git a/src/bin/d2/tests/d_test_stubs.cc b/src/bin/d2/tests/d_test_stubs.cc index ee7afc5933..fa91cd3518 100644 --- a/src/bin/d2/tests/d_test_stubs.cc +++ b/src/bin/d2/tests/d_test_stubs.cc @@ -157,8 +157,8 @@ DStubController::DStubController() : DControllerBase(stub_app_name_, stub_bin_name_), processed_signals_(), record_signal_only_(false) { - if (getenv("B10_FROM_BUILD")) { - setSpecFileName(std::string(getenv("B10_FROM_BUILD")) + + if (getenv("KEA_FROM_BUILD")) { + setSpecFileName(std::string(getenv("KEA_FROM_BUILD")) + "/src/bin/d2/dhcp-ddns.spec"); } else { setSpecFileName(D2_SPECFILE_LOCATION); diff --git a/src/bin/d2/tests/dns_client_unittests.cc b/src/bin/d2/tests/dns_client_unittests.cc index 67d32743dc..126660ab4f 100644 --- a/src/bin/d2/tests/dns_client_unittests.cc +++ b/src/bin/d2/tests/dns_client_unittests.cc @@ -320,7 +320,7 @@ public: /// instantly. However, it may lead to situations that the message sent /// in one test will not be dropped by the kernel by the time, the next /// test starts. This will lead to intermittent unit test errors as - /// described in the ticket http://bind10.isc.org/ticket/3265. + /// described in the ticket http://kea.isc.org/ticket/3265. /// Increasing the timeout to a non-zero value mitigates this problem. /// The proper way to solve this problem is to receive the packet /// on our own and drop it. Such a fix will need to be applied not only diff --git a/src/bin/dhcp4/bundy_controller.cc b/src/bin/dhcp4/bundy_controller.cc index a85e50e2e3..64a17558ec 100644 --- a/src/bin/dhcp4/bundy_controller.cc +++ b/src/bin/dhcp4/bundy_controller.cc @@ -139,8 +139,8 @@ void ControlledDhcpv4Srv::init(const std::string& config_file) { Daemon::init(config_file); string specfile; - if (getenv("B10_FROM_BUILD")) { - specfile = string(getenv("B10_FROM_BUILD")) + + if (getenv("KEA_FROM_BUILD")) { + specfile = string(getenv("KEA_FROM_BUILD")) + "/src/bin/dhcp4/dhcp4.spec"; } else { specfile = string(DHCP4_SPECFILE_LOCATION); diff --git a/src/bin/dhcp4/kea_controller.cc b/src/bin/dhcp4/kea_controller.cc index 4ef51a6976..146e93bc79 100644 --- a/src/bin/dhcp4/kea_controller.cc +++ b/src/bin/dhcp4/kea_controller.cc @@ -172,11 +172,11 @@ void ControlledDhcpv4Srv::cleanup() { /// @todo: Implement this properly (see #3427) void Daemon::loggerInit(const char*, bool verbose) { - setenv("B10_LOCKFILE_DIR_FROM_BUILD", "/tmp", 1); - setenv("B10_LOGGER_ROOT", "kea", 0); - setenv("B10_LOGGER_SEVERITY", (verbose ? "DEBUG":"INFO"), 0); - setenv("B10_LOGGER_DBGLEVEL", "99", 0); - setenv("B10_LOGGER_DESTINATION", "stdout", 0); + setenv("KEA_LOCKFILE_DIR_FROM_BUILD", "/tmp", 1); + setenv("KEA_LOGGER_ROOT", "kea", 0); + setenv("KEA_LOGGER_SEVERITY", (verbose ? "DEBUG":"INFO"), 0); + setenv("KEA_LOGGER_DBGLEVEL", "99", 0); + setenv("KEA_LOGGER_DESTINATION", "stdout", 0); isc::log::initLogger(); } diff --git a/src/bin/dhcp4/tests/dhcp4_unittests.cc b/src/bin/dhcp4/tests/dhcp4_unittests.cc index 93e836b166..f57cfa429f 100644 --- a/src/bin/dhcp4/tests/dhcp4_unittests.cc +++ b/src/bin/dhcp4/tests/dhcp4_unittests.cc @@ -21,7 +21,7 @@ main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); - // See the documentation of the B10_* environment variables in + // See the documentation of the KEA_* environment variables in // src/lib/log/README for info on how to tweak logging isc::log::initLogger(); diff --git a/src/bin/dhcp6/bundy_controller.cc b/src/bin/dhcp6/bundy_controller.cc index 672b23d26b..062c27f181 100644 --- a/src/bin/dhcp6/bundy_controller.cc +++ b/src/bin/dhcp6/bundy_controller.cc @@ -144,8 +144,8 @@ ControlledDhcpv6Srv::init(const std::string& config_file) { // configuration from cfgmgr (or indirectly from user via bindctl). string specfile; - if (getenv("B10_FROM_BUILD")) { - specfile = string(getenv("B10_FROM_BUILD")) + + if (getenv("KEA_FROM_BUILD")) { + specfile = string(getenv("KEA_FROM_BUILD")) + "/src/bin/dhcp6/dhcp6.spec"; } else { specfile = string(DHCP6_SPECFILE_LOCATION); diff --git a/src/bin/dhcp6/kea_controller.cc b/src/bin/dhcp6/kea_controller.cc index 0fafe21cfe..c39cd56afa 100644 --- a/src/bin/dhcp6/kea_controller.cc +++ b/src/bin/dhcp6/kea_controller.cc @@ -174,11 +174,11 @@ void ControlledDhcpv6Srv::cleanup() { /// @todo: Implement this properly (see #3427) void Daemon::loggerInit(const char*, bool verbose) { - setenv("B10_LOCKFILE_DIR_FROM_BUILD", "/tmp", 1); - setenv("B10_LOGGER_ROOT", "kea", 0); - setenv("B10_LOGGER_SEVERITY", (verbose ? "DEBUG":"INFO"), 0); - setenv("B10_LOGGER_DBGLEVEL", "99", 0); - setenv("B10_LOGGER_DESTINATION", "stdout", 0); + setenv("KEA_LOCKFILE_DIR_FROM_BUILD", "/tmp", 1); + setenv("KEA_LOGGER_ROOT", "kea", 0); + setenv("KEA_LOGGER_SEVERITY", (verbose ? "DEBUG":"INFO"), 0); + setenv("KEA_LOGGER_DBGLEVEL", "99", 0); + setenv("KEA_LOGGER_DESTINATION", "stdout", 0); isc::log::initLogger(); } diff --git a/src/lib/config/ccsession.cc b/src/lib/config/ccsession.cc index 0cc0ac5a3f..532709a394 100644 --- a/src/lib/config/ccsession.cc +++ b/src/lib/config/ccsession.cc @@ -178,7 +178,7 @@ ConstElementPtr getValueOrDefault(ConstElementPtr config_part, } } -/// @brief Prefix name with "b10-". +/// @brief Prefix name with "kea-". /// /// In BIND 10, modules had names taken from the .spec file, which are typically /// names starting with a capital letter (e.g. "Resolver", "Auth" etc.). The @@ -190,26 +190,26 @@ ConstElementPtr getValueOrDefault(ConstElementPtr config_part, /// In Kea we're not using module names, but we do still keep some capability to /// run Kea servers in Bundy framework. For that reason the whole discussion here /// applies only to case when Kea is compiled with Bundy configuration backend. -// -// Within the binaries the root loggers are named after the binaries themselves. -// (The reason for this is that the name of the logger is included in the -// message logged, so making it clear which message comes from which Kea -// process.) As logging is configured using module names, the configuration code -// has to match these with the corresponding logger names. This function -// converts a module name to a root logger name by lowercasing the first letter -// of the module name and prepending "b10-". -// -// \param instring String to convert. (This may be empty, in which case -// "b10-" will be returned.) -// -// \return Converted string. +/// +/// Within the binaries the root loggers are named after the binaries themselves. +/// (The reason for this is that the name of the logger is included in the +/// message logged, so making it clear which message comes from which Kea +/// process.) As logging is configured using module names, the configuration code +/// has to match these with the corresponding logger names. This function +/// converts a module name to a root logger name by lowercasing the first letter +/// of the module name and prepending "kea-". +/// +/// \param instring String to convert. (This may be empty, in which case +/// "kea-" will be returned.) +/// +/// \return Converted string. std::string -b10Prefix(const std::string& instring) { +keaPrefix(const std::string& instring) { std::string result = instring; if (!result.empty()) { result[0] = tolower(result[0]); } - return (std::string("b10-") + result); + return (std::string("kea-") + result); } // Reads a output_option subelement of a logger configuration, @@ -318,16 +318,16 @@ getRelatedLoggers(ConstElementPtr loggers) { ElementPtr result = isc::data::Element::createList(); BOOST_FOREACH(ConstElementPtr cur_logger, loggers->listValue()) { - // Need to add the b10- prefix to names ready from the spec file. + // Need to add the kea- prefix to names ready from the spec file. const std::string cur_name = cur_logger->get("name")->stringValue(); - const std::string mod_name = b10Prefix(cur_name); + const std::string mod_name = keaPrefix(cur_name); if (mod_name == root_name || mod_name.find(root_name + ".") == 0) { // Note this name so that we don't add a wildcard that matches it. our_names.insert(mod_name); // We want to store the logger with the modified name (i.e. with - // the b10- prefix). As we are dealing with const loggers, we + // the kea- prefix). As we are dealing with const loggers, we // store a modified copy of the data. result->add(copyLogger(cur_logger, mod_name)); LOG_DEBUG(config_logger, DBG_CONFIG_PROCESS, CONFIG_LOG_EXPLICIT) diff --git a/src/lib/config/tests/ccsession_unittests.cc b/src/lib/config/tests/ccsession_unittests.cc index fc5c3585b7..41d43d5830 100644 --- a/src/lib/config/tests/ccsession_unittests.cc +++ b/src/lib/config/tests/ccsession_unittests.cc @@ -1165,8 +1165,8 @@ void doRelatedLoggersTest(const char* input, const char* expected) { TEST(LogConfigTest, relatedLoggersTest) { // make sure logger configs for 'other' programs are ignored, // and that * is substituted correctly - // We'll use a root logger name of "b10-test". - isc::log::setRootLoggerName("b10-test"); + // We'll use a root logger name of "kea-test". + isc::log::setRootLoggerName("kea-test"); doRelatedLoggersTest("[{ \"name\": \"other_module\" }]", "[]"); @@ -1178,30 +1178,30 @@ TEST(LogConfigTest, relatedLoggersTest) { "[]"); doRelatedLoggersTest("[ { \"name\": \"other_module\" }," " { \"name\": \"test\" }]", - "[ { \"name\": \"b10-test\" } ]"); + "[ { \"name\": \"kea-test\" } ]"); doRelatedLoggersTest("[ { \"name\": \"test\" }]", - "[ { \"name\": \"b10-test\" } ]"); + "[ { \"name\": \"kea-test\" } ]"); doRelatedLoggersTest("[ { \"name\": \"test.somelib\" }]", - "[ { \"name\": \"b10-test.somelib\" } ]"); + "[ { \"name\": \"kea-test.somelib\" } ]"); doRelatedLoggersTest("[ { \"name\": \"other_module.somelib\" }," " { \"name\": \"test.somelib\" }]", - "[ { \"name\": \"b10-test.somelib\" } ]"); + "[ { \"name\": \"kea-test.somelib\" } ]"); doRelatedLoggersTest("[ { \"name\": \"other_module.somelib\" }," " { \"name\": \"test\" }," " { \"name\": \"test.somelib\" }]", - "[ { \"name\": \"b10-test\" }," - " { \"name\": \"b10-test.somelib\" } ]"); + "[ { \"name\": \"kea-test\" }," + " { \"name\": \"kea-test.somelib\" } ]"); doRelatedLoggersTest("[ { \"name\": \"*\" }]", - "[ { \"name\": \"b10-test\" } ]"); + "[ { \"name\": \"kea-test\" } ]"); doRelatedLoggersTest("[ { \"name\": \"*.somelib\" }]", - "[ { \"name\": \"b10-test.somelib\" } ]"); + "[ { \"name\": \"kea-test.somelib\" } ]"); doRelatedLoggersTest("[ { \"name\": \"*\", \"severity\": \"DEBUG\" }," " { \"name\": \"test\", \"severity\": \"WARN\"}]", - "[ { \"name\": \"b10-test\", \"severity\": \"WARN\"} ]"); + "[ { \"name\": \"kea-test\", \"severity\": \"WARN\"} ]"); doRelatedLoggersTest("[ { \"name\": \"*\", \"severity\": \"DEBUG\" }," " { \"name\": \"some_module\", \"severity\": \"WARN\"}]", - "[ { \"name\": \"b10-test\", \"severity\": \"DEBUG\"} ]"); - doRelatedLoggersTest("[ { \"name\": \"b10-test\" }]", + "[ { \"name\": \"kea-test\", \"severity\": \"DEBUG\"} ]"); + doRelatedLoggersTest("[ { \"name\": \"kea-test\" }]", "[]"); // make sure 'bad' things like '*foo.x' or '*lib' are ignored // (cfgmgr should have already caught it in the logconfig plugin @@ -1213,7 +1213,7 @@ TEST(LogConfigTest, relatedLoggersTest) { doRelatedLoggersTest("[ { \"name\": \"*foo\" }," " { \"name\": \"*foo.lib\" }," " { \"name\": \"test\" } ]", - "[ { \"name\": \"b10-test\" } ]"); + "[ { \"name\": \"kea-test\" } ]"); } } diff --git a/src/lib/dhcp/option6_client_fqdn.cc b/src/lib/dhcp/option6_client_fqdn.cc index d9eb0b230b..2fadb897a8 100644 --- a/src/lib/dhcp/option6_client_fqdn.cc +++ b/src/lib/dhcp/option6_client_fqdn.cc @@ -27,8 +27,8 @@ namespace dhcp { /// /// The purpose of the class is to separate the implementation details /// of the Option6ClientFqdn class from the interface. This implementation -/// uses b10-libdns classes to process FQDNs. At some point it may be -/// desired to split b10-libdhcp++ from b10-libdns. In such case the +/// uses kea-libdns classes to process FQDNs. At some point it may be +/// desired to split kea-libdhcp++ from kea-libdns. In such case the /// implementation of this class may be changed. The declaration of the /// Option6ClientFqdn class holds the pointer to implementation, so /// the transition to a different implementation would not affect the diff --git a/src/lib/log/interprocess/interprocess_sync_file.cc b/src/lib/log/interprocess/interprocess_sync_file.cc index 7f8fcb4fea..17c4dce3a6 100644 --- a/src/lib/log/interprocess/interprocess_sync_file.cc +++ b/src/lib/log/interprocess/interprocess_sync_file.cc @@ -46,17 +46,17 @@ InterprocessSyncFile::do_lock(int cmd, short l_type) { if (fd_ == -1) { std::string lockfile_path = LOCKFILE_DIR; - const char* const env = getenv("B10_FROM_BUILD"); + const char* const env = getenv("KEA_FROM_BUILD"); if (env != NULL) { lockfile_path = env; } - const char* const env2 = getenv("B10_FROM_BUILD_LOCALSTATEDIR"); + const char* const env2 = getenv("KEA_FROM_BUILD_LOCALSTATEDIR"); if (env2 != NULL) { lockfile_path = env2; } - const char* const env3 = getenv("B10_LOCKFILE_DIR_FROM_BUILD"); + const char* const env3 = getenv("KEA_LOCKFILE_DIR_FROM_BUILD"); if (env3 != NULL) { lockfile_path = env3; } diff --git a/src/lib/log/interprocess/tests/run_unittests.cc b/src/lib/log/interprocess/tests/run_unittests.cc index 03fb3220d1..677a41d761 100644 --- a/src/lib/log/interprocess/tests/run_unittests.cc +++ b/src/lib/log/interprocess/tests/run_unittests.cc @@ -20,6 +20,6 @@ int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); - setenv("B10_LOCKFILE_DIR_FROM_BUILD", TEST_DATA_TOPBUILDDIR, 1); + setenv("KEA_LOCKFILE_DIR_FROM_BUILD", TEST_DATA_TOPBUILDDIR, 1); return (isc::util::unittests::run_all()); } diff --git a/src/lib/log/logger_manager_impl.cc b/src/lib/log/logger_manager_impl.cc index 987c7c1ea4..13475a68bd 100644 --- a/src/lib/log/logger_manager_impl.cc +++ b/src/lib/log/logger_manager_impl.cc @@ -227,16 +227,16 @@ void LoggerManagerImpl::initRootLogger(isc::log::Severity severity, // Set the level for the Kea root logger to the given severity and // debug level. - log4cplus::Logger b10root = log4cplus::Logger::getInstance( + log4cplus::Logger kea_root = log4cplus::Logger::getInstance( getRootLoggerName()); - b10root.setLogLevel(LoggerLevelImpl::convertFromBindLevel( + kea_root.setLogLevel(LoggerLevelImpl::convertFromBindLevel( Level(severity, dbglevel))); if (buffer) { - createBufferAppender(b10root); + createBufferAppender(kea_root); } else { OutputOption opt; - createConsoleAppender(b10root, opt); + createConsoleAppender(kea_root, opt); } } diff --git a/src/lib/log/logger_unittest_support.cc b/src/lib/log/logger_unittest_support.cc index 1266cb3c10..2c8a063c2b 100644 --- a/src/lib/log/logger_unittest_support.cc +++ b/src/lib/log/logger_unittest_support.cc @@ -30,13 +30,13 @@ namespace isc { namespace log { // Get the logging severity. This is defined by the environment variable -// B10_LOGGER_SEVERITY, and can be one of "DEBUG", "INFO", "WARN", "ERROR" +// KEA_LOGGER_SEVERITY, and can be one of "DEBUG", "INFO", "WARN", "ERROR" // of "FATAL". (Note that the string must be in upper case with no leading // of trailing blanks.) If not present, the default severity passed to the // function is returned. isc::log::Severity -b10LoggerSeverity(isc::log::Severity defseverity) { - const char* sev_char = getenv("B10_LOGGER_SEVERITY"); +keaLoggerSeverity(isc::log::Severity defseverity) { + const char* sev_char = getenv("KEA_LOGGER_SEVERITY"); if (sev_char) { return (isc::log::getSeverity(sev_char)); } @@ -44,11 +44,11 @@ b10LoggerSeverity(isc::log::Severity defseverity) { } // Get the debug level. This is defined by the environment variable -// B10_LOGGER_DBGLEVEL. If not defined, a default value passed to the function +// KEA_LOGGER_DBGLEVEL. If not defined, a default value passed to the function // is returned. int -b10LoggerDbglevel(int defdbglevel) { - const char* dbg_char = getenv("B10_LOGGER_DBGLEVEL"); +keaLoggerDbglevel(int defdbglevel) { + const char* dbg_char = getenv("KEA_LOGGER_DBGLEVEL"); if (dbg_char) { int level = 0; try { @@ -67,7 +67,7 @@ b10LoggerDbglevel(int defdbglevel) { } catch (...) { // Error, but not fatal to the test std::cerr << "**ERROR** Unable to translate " - "B10_LOGGER_DBGLEVEL - a value of 0 will be used\n"; + "KEA_LOGGER_DBGLEVEL - a value of 0 will be used\n"; } return (level); } @@ -77,7 +77,7 @@ b10LoggerDbglevel(int defdbglevel) { // Reset characteristics of the root logger to that set by the environment -// variables B10_LOGGER_SEVERITY, B10_LOGGER_DBGLEVEL and B10_LOGGER_DESTINATION. +// variables KEA_LOGGER_SEVERITY, KEA_LOGGER_DBGLEVEL and KEA_LOGGER_DESTINATION. void resetUnitTestRootLogger() { @@ -96,13 +96,13 @@ resetUnitTestRootLogger() { // severity for unit tests is DEBUG, which generates a lot of output. // Routing the logging to /dev/null will suppress that, whilst still // ensuring that the code paths are tested.) - const char* destination = getenv("B10_LOGGER_DESTINATION"); + const char* destination = getenv("KEA_LOGGER_DESTINATION"); const string dest((destination == NULL) ? DEVNULL : destination); // Prepare the objects to define the logging specification LoggerSpecification spec(getRootLoggerName(), - b10LoggerSeverity(isc::log::DEBUG), - b10LoggerDbglevel(isc::log::MAX_DEBUG_LEVEL)); + keaLoggerSeverity(isc::log::DEBUG), + keaLoggerDbglevel(isc::log::MAX_DEBUG_LEVEL)); OutputOption option; // Set up output option according to destination specification @@ -123,7 +123,7 @@ resetUnitTestRootLogger() { option.destination = OutputOption::DEST_SYSLOG; // Must take account of the string actually being "syslog:" if (dest == SYSLOG_COLON) { - cerr << "**ERROR** value for B10_LOGGER_DESTINATION of " << + cerr << "**ERROR** value for KEA_LOGGER_DESTINATION of " << SYSLOG_COLON << " is invalid, " << SYSLOG << " will be used instead\n"; // Use default for logging facility @@ -149,7 +149,7 @@ resetUnitTestRootLogger() { // Logger Run-Time Initialization via Environment Variables void initLogger(isc::log::Severity severity, int dbglevel) { - // Root logger name is defined by the environment variable B10_LOGGER_ROOT. + // Root logger name is defined by the environment variable KEA_LOGGER_ROOT. // If not present, the name is "kea". const char* DEFAULT_ROOT = "kea"; const char* root = getenv("KEA_LOGGER_ROOT"); @@ -158,10 +158,10 @@ void initLogger(isc::log::Severity severity, int dbglevel) { } // Set the local message file - const char* localfile = getenv("B10_LOGGER_LOCALMSG"); + const char* localfile = getenv("KEA_LOGGER_LOCALMSG"); // Set a directory for creating lockfiles when running tests - setenv("B10_LOCKFILE_DIR_FROM_BUILD", TOP_BUILDDIR, 1); + setenv("KEA_LOCKFILE_DIR_FROM_BUILD", TOP_BUILDDIR, 1); // Initialize logging initLogger(root, isc::log::DEBUG, isc::log::MAX_DEBUG_LEVEL, localfile); diff --git a/src/lib/log/logger_unittest_support.h b/src/lib/log/logger_unittest_support.h index 28baa5ca00..518460c9ab 100644 --- a/src/lib/log/logger_unittest_support.h +++ b/src/lib/log/logger_unittest_support.h @@ -33,27 +33,27 @@ namespace log { /// Performs run-time initialization of the logger via the setting of /// environment variables. These are: /// -/// - B10_LOGGER_ROOT\n +/// - KEA_LOGGER_ROOT\n /// Name of the root logger. If not given, the string "kea" will be used. /// -/// - B10_LOGGER_SEVERITY\n +/// - KEA_LOGGER_SEVERITY\n /// Severity of messages that will be logged. This must be one of the strings /// "DEBUG", "INFO", "WARN", "ERROR", "FATAL" or "NONE". (Must be upper case /// and must not contain leading or trailing spaces.) If not specified (or if /// specified but incorrect), the default passed as argument to this function /// (currently DEBUG) will be used. /// -/// - B10_LOGGER_DBGLEVEL\n +/// - KEA_LOGGER_DBGLEVEL\n /// Ignored if the level is not DEBUG, this should be a number between 0 and /// 99 indicating the logging severity. The default is 0. If outside these /// limits or if not a number, The value passed to this function (default /// of MAX_DEBUG_LEVEL) is used. /// -/// - B10_LOGGER_LOCALMSG\n +/// - KEA_LOGGER_LOCALMSG\n /// If defined, the path specification of a file that contains message /// definitions replacing ones in the default dictionary. /// -/// - B10_LOGGER_DESTINATION\n +/// - KEA_LOGGER_DESTINATION\n /// If defined, the destination of the logging output. This can be one of: /// - \c stdout Send output to stdout. /// - \c stderr Send output to stderr @@ -70,29 +70,29 @@ namespace log { /// be overridden by the tester. It is not intended for use in production /// code. /// -/// TODO: Rename. This function overloads the initLogger() function that can +/// @todo: Rename. This function overloads the initLogger() function that can /// be used to initialize production programs. This may lead to confusion. void initLogger(isc::log::Severity severity = isc::log::DEBUG, int dbglevel = isc::log::MAX_DEBUG_LEVEL); -/// \brief Obtains logging severity from B10_LOGGER_SEVERITY +/// \brief Obtains logging severity from KEA_LOGGER_SEVERITY /// /// Support function called by the unit test logging initialization code. -/// It returns the logging severity defined by B10_LOGGER_SEVERITY. If +/// It returns the logging severity defined by KEA_LOGGER_SEVERITY. If /// not defined it returns the default passed to it. /// -/// \param defseverity Default severity used if B10_LOGGER_SEVERITY is not +/// \param defseverity Default severity used if KEA_LOGGER_SEVERITY is not // defined. /// /// \return Severity to use for the logging. -isc::log::Severity b10LoggerSeverity(isc::log::Severity defseverity); +isc::log::Severity keaLoggerSeverity(isc::log::Severity defseverity); -/// \brief Obtains logging debug level from B10_LOGGER_DBGLEVEL +/// \brief Obtains logging debug level from KEA_LOGGER_DBGLEVEL /// /// Support function called by the unit test logging initialization code. -/// It returns the logging debug level defined by B10_LOGGER_DBGLEVEL. If +/// It returns the logging debug level defined by KEA_LOGGER_DBGLEVEL. If /// not defined, it returns the default passed to it. /// /// N.B. If there is an error, a message is written to stderr and a value @@ -101,11 +101,11 @@ isc::log::Severity b10LoggerSeverity(isc::log::Severity defseverity); /// function is only used in unit test logging initialization, so incorrect /// selection of a level is not really an issue.) /// -/// \param defdbglevel Default debug level to be used if B10_LOGGER_DBGLEVEL +/// \param defdbglevel Default debug level to be used if KEA_LOGGER_DBGLEVEL /// is not defined. /// /// \return Debug level to use. -int b10LoggerDbglevel(int defdbglevel); +int keaLoggerDbglevel(int defdbglevel); /// \brief Reset root logger characteristics @@ -113,8 +113,8 @@ int b10LoggerDbglevel(int defdbglevel); /// This is a simplified interface into the resetting of the characteristics /// of the root logger. It is aimed for use in unit tests and resets the /// characteristics of the root logger to use a severity, debug level and -/// destination set by the environment variables B10_LOGGER_SEVERITY, -/// B10_LOGGER_DBGLEVEL and B10_LOGGER_DESTINATION. +/// destination set by the environment variables KEA_LOGGER_SEVERITY, +/// KEA_LOGGER_DBGLEVEL and KEA_LOGGER_DESTINATION. void resetUnitTestRootLogger(); diff --git a/src/lib/util/threads/sync.h b/src/lib/util/threads/sync.h index 9777041278..64b3bc588e 100644 --- a/src/lib/util/threads/sync.h +++ b/src/lib/util/threads/sync.h @@ -12,8 +12,8 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#ifndef B10_THREAD_SYNC_H -#define B10_THREAD_SYNC_H +#ifndef KEA_THREAD_SYNC_H +#define KEA_THREAD_SYNC_H #include diff --git a/src/lib/util/threads/tests/run_unittests.cc b/src/lib/util/threads/tests/run_unittests.cc index 6f71ad6734..8ea4a25279 100644 --- a/src/lib/util/threads/tests/run_unittests.cc +++ b/src/lib/util/threads/tests/run_unittests.cc @@ -20,6 +20,6 @@ int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); - setenv("B10_LOCKFILE_DIR_FROM_BUILD", TEST_DATA_TOPBUILDDIR, 1); + setenv("KEA_LOCKFILE_DIR_FROM_BUILD", TEST_DATA_TOPBUILDDIR, 1); return (isc::util::unittests::run_all()); } diff --git a/src/lib/util/threads/thread.h b/src/lib/util/threads/thread.h index 9c6d20a4b6..236e5776ed 100644 --- a/src/lib/util/threads/thread.h +++ b/src/lib/util/threads/thread.h @@ -12,8 +12,8 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#ifndef B10_THREAD_H -#define B10_THREAD_H +#ifndef KEA_THREAD_H +#define KEA_THREAD_H #include diff --git a/src/lib/util/unittests/run_all.cc b/src/lib/util/unittests/run_all.cc index 0e3492b64d..80555ba798 100644 --- a/src/lib/util/unittests/run_all.cc +++ b/src/lib/util/unittests/run_all.cc @@ -30,7 +30,7 @@ run_all() { int ret = 0; // The catching of exceptions generated in tests is controlled by the - // B10TEST_CATCH_EXCEPTION environment variable. Setting this to + // KEATEST_CATCH_EXCEPTION environment variable. Setting this to // 1 enables the catching of exceptions; setting it to 0 disables it. // Anything else causes a message to be printed to stderr and the default // taken. (The default is to catch exceptions if compiling with clang @@ -41,15 +41,15 @@ run_all() { bool catch_exception = false; #endif - const char* b10test_catch_exception = getenv("B10TEST_CATCH_EXCEPTION"); - if (b10test_catch_exception != NULL) { - if (strcmp(b10test_catch_exception, "1") == 0) { + const char* keatest_catch_exception = getenv("KEATEST_CATCH_EXCEPTION"); + if (keatest_catch_exception != NULL) { + if (strcmp(keatest_catch_exception, "1") == 0) { catch_exception = true; } else if (strcmp(b10test_catch_exception, "0") == 0) { catch_exception = false; } else { - std::cerr << "***ERROR: B10TEST_CATCH_EXCEPTION is '" - << b10test_catch_exception + std::cerr << "***ERROR: KEATEST_CATCH_EXCEPTION is '" + << keatest_catch_exception << "': allowed values are '1' or '0'.\n" << " The default value of " << (catch_exception ? diff --git a/src/lib/util/unittests/run_all.h b/src/lib/util/unittests/run_all.h index 2335df71dc..aab57dc5b0 100644 --- a/src/lib/util/unittests/run_all.h +++ b/src/lib/util/unittests/run_all.h @@ -29,7 +29,7 @@ namespace unittests { /// /// A wrapper for the Google Test RUN_ALL_TESTS() macro, this calls the macro /// but wraps the call in a try...catch block if the environment variable -/// B10TEST_CATCH_EXCEPTION is defined, and calls the macro directly if not. +/// KEATEST_CATCH_EXCEPTION is defined, and calls the macro directly if not. /// /// The catch block catches exceptions of types isc::Exception and /// std::exception and prints some information about them to stderr. (In the