Browse Source

[master] Finished merge of trac2358a (DBGLVL_xxx)

Francis Dupont 8 years ago
parent
commit
d8e2ffa5a1

+ 1 - 1
src/bin/agent/ca_process.cc

@@ -117,7 +117,7 @@ CtrlAgentProcess::run() {
         // What to do? Simply ignore...
     }
 
-    LOG_DEBUG(agent_logger, DBGLVL_START_SHUT, CTRL_AGENT_RUN_EXIT);
+    LOG_DEBUG(agent_logger, isc::log::DBGLVL_START_SHUT, CTRL_AGENT_RUN_EXIT);
 }
 
 isc::data::ConstElementPtr

+ 10 - 10
src/bin/d2/d2_process.cc

@@ -80,7 +80,7 @@ D2Process::run() {
     // this might be the place to do it, once there is a persistence mgr.
     // This may also be better in checkQueueStatus.
 
-    LOG_DEBUG(d2_logger, DBGLVL_START_SHUT, DHCP_DDNS_RUN_EXIT);
+    LOG_DEBUG(d2_logger, isc::log::DBGLVL_START_SHUT, DHCP_DDNS_RUN_EXIT);
 
 };
 
@@ -147,9 +147,9 @@ D2Process::canShutdown() const {
         }
 
         if (all_clear) {
-            LOG_DEBUG(d2_logger, DBGLVL_START_SHUT,
+            LOG_DEBUG(d2_logger, isc::log::DBGLVL_START_SHUT,
                      DHCP_DDNS_CLEARED_FOR_SHUTDOWN)
-                     .arg(getShutdownTypeStr(shutdown_type_));
+                .arg(getShutdownTypeStr(shutdown_type_));
         }
     }
 
@@ -158,8 +158,9 @@ D2Process::canShutdown() const {
 
 isc::data::ConstElementPtr
 D2Process::shutdown(isc::data::ConstElementPtr args) {
-    LOG_DEBUG(d2_logger, DBGLVL_START_SHUT, DHCP_DDNS_SHUTDOWN_COMMAND)
-              .arg(args ? args->str() : "(no arguments)");
+    LOG_DEBUG(d2_logger, isc::log::DBGLVL_START_SHUT,
+              DHCP_DDNS_SHUTDOWN_COMMAND)
+        .arg(args ? args->str() : "(no arguments)");
 
     // Default shutdown type is normal.
     std::string type_str(getShutdownTypeStr(SD_NORMAL));
@@ -192,7 +193,7 @@ D2Process::shutdown(isc::data::ConstElementPtr args) {
 
 isc::data::ConstElementPtr
 D2Process::configure(isc::data::ConstElementPtr config_set, bool check_only) {
-    LOG_DEBUG(d2_logger, DBGLVL_TRACE_BASIC, DHCP_DDNS_CONFIGURE)
+    LOG_DEBUG(d2_logger, isc::log::DBGLVL_TRACE_BASIC, DHCP_DDNS_CONFIGURE)
         .arg(check_only ? "check" : "update")
         .arg(config_set->str());
 
@@ -243,10 +244,9 @@ D2Process::checkQueueStatus() {
             // canceling active listening which may generate an IO event, so
             // instigate the stop and get out.
             try {
-                LOG_DEBUG(d2_logger, DBGLVL_START_SHUT,
+                LOG_DEBUG(d2_logger, isc::log::DBGLVL_START_SHUT,
                           DHCP_DDNS_QUEUE_MGR_STOPPING)
-                         .arg(reconf_queue_flag_ ? "reconfiguration"
-                                                 : "shutdown");
+                    .arg(reconf_queue_flag_ ? "reconfiguration" : "shutdown");
                 queue_mgr_->stopListening();
             } catch (const isc::Exception& ex) {
                 // It is very unlikely that we would experience an error
@@ -303,7 +303,7 @@ D2Process::checkQueueStatus() {
         // we can do the reconfigure. In other words, we aren't RUNNING or
         // STOPPING.
         if (reconf_queue_flag_) {
-            LOG_DEBUG(d2_logger, DBGLVL_TRACE_BASIC,
+            LOG_DEBUG(d2_logger, isc::log::DBGLVL_TRACE_BASIC,
                       DHCP_DDNS_QUEUE_MGR_RECONFIGURING);
             reconfigureQueueMgr();
         }

+ 6 - 3
src/bin/d2/d2_queue_mgr.cc

@@ -48,7 +48,8 @@ D2QueueMgr::operator()(const dhcp_ddns::NameChangeListener::Result result,
                 enqueue(ncr);
 
                 // Log that we got the request
-                LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
+                LOG_DEBUG(dhcp_to_d2_logger,
+                          isc::log::DBGLVL_TRACE_DETAIL_DATA,
                           DHCP_DDNS_QUEUE_MGR_QUEUE_RECEIVE)
                           .arg(ncr->getRequestId());
                 return;
@@ -137,7 +138,8 @@ D2QueueMgr::startListening() {
                   << ex.what());
     }
 
-    LOG_DEBUG(d2_logger, DBGLVL_START_SHUT, DHCP_DDNS_QUEUE_MGR_STARTED);
+    LOG_DEBUG(d2_logger, isc::log::DBGLVL_START_SHUT,
+              DHCP_DDNS_QUEUE_MGR_STARTED);
 }
 
 void
@@ -172,7 +174,8 @@ D2QueueMgr::stopListening(const State target_stop_state) {
 void
 D2QueueMgr::updateStopState() {
     mgr_state_ = target_stop_state_;
-    LOG_DEBUG(d2_logger, DBGLVL_TRACE_BASIC, DHCP_DDNS_QUEUE_MGR_STOPPED);
+    LOG_DEBUG(d2_logger, isc::log::DBGLVL_TRACE_BASIC,
+              DHCP_DDNS_QUEUE_MGR_STOPPED);
 }
 
 

+ 7 - 6
src/bin/d2/d2_update_mgr.cc

@@ -56,7 +56,7 @@ void D2UpdateMgr::sweep() {
     // frequently.  It will likely achieve max transactions quickly on its own.
     if (getQueueCount() > 0)  {
         if (getTransactionCount() >= max_transactions_) {
-            LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
+            LOG_DEBUG(dhcp_to_d2_logger, isc::log::DBGLVL_TRACE_DETAIL_DATA,
                       DHCP_DDNS_AT_MAX_TRANSACTIONS).arg(getQueueCount())
                       .arg(getMaxTransactions());
 
@@ -110,8 +110,9 @@ void D2UpdateMgr::pickNextJob() {
 
     // There were no eligible jobs. All of the current DHCIDs already have
     // transactions pending.
-    LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA, DHCP_DDNS_NO_ELIGIBLE_JOBS)
-              .arg(getQueueCount()).arg(getTransactionCount());
+    LOG_DEBUG(dhcp_to_d2_logger, isc::log::DBGLVL_TRACE_DETAIL_DATA,
+              DHCP_DDNS_NO_ELIGIBLE_JOBS)
+        .arg(getQueueCount()).arg(getTransactionCount());
 }
 
 void
@@ -132,7 +133,7 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
     if (next_ncr->isForwardChange()) {
         if (!cfg_mgr_->forwardUpdatesEnabled()) {
             next_ncr->setForwardChange(false);
-            LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
+            LOG_DEBUG(dhcp_to_d2_logger, isc::log::DBGLVL_TRACE_DETAIL_DATA,
                       DHCP_DDNS_FWD_REQUEST_IGNORED)
                       .arg(next_ncr->getRequestId())
                       .arg(next_ncr->toText());
@@ -158,7 +159,7 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
     if (next_ncr->isReverseChange()) {
         if (!cfg_mgr_->reverseUpdatesEnabled()) {
             next_ncr->setReverseChange(false);
-            LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
+            LOG_DEBUG(dhcp_to_d2_logger, isc::log::DBGLVL_TRACE_DETAIL_DATA,
                       DHCP_DDNS_REV_REQUEST_IGNORED)
                       .arg(next_ncr->getRequestId())
                       .arg(next_ncr->toText());
@@ -182,7 +183,7 @@ D2UpdateMgr::makeTransaction(dhcp_ddns::NameChangeRequestPtr& next_ncr) {
     // If there is nothing to actually do, then the request falls on the floor.
     // Should we log this?
     if (!direction_count) {
-        LOG_DEBUG(dhcp_to_d2_logger, DBGLVL_TRACE_DETAIL_DATA,
+        LOG_DEBUG(dhcp_to_d2_logger, isc::log::DBGLVL_TRACE_DETAIL_DATA,
                   DHCP_DDNS_REQUEST_DROPPED)
                   .arg(next_ncr->getRequestId())
                   .arg(next_ncr->toText());

+ 1 - 1
src/bin/d2/dns_client.cc

@@ -139,7 +139,7 @@ DNSClientImpl::operator()(asiodns::IOFetch::Result result) {
                                 tsig_context_.get());
         } catch (const isc::Exception& ex) {
             status = DNSClient::INVALID_RESPONSE;
-            LOG_DEBUG(d2_to_dns_logger, DBGLVL_TRACE_DETAIL,
+            LOG_DEBUG(d2_to_dns_logger, isc::log::DBGLVL_TRACE_DETAIL,
                       DHCP_DDNS_INVALID_RESPONSE).arg(ex.what());
 
         }

+ 3 - 3
src/bin/d2/nc_trans.cc

@@ -83,7 +83,7 @@ NameChangeTransaction::~NameChangeTransaction(){
 
 void
 NameChangeTransaction::startTransaction() {
-    LOG_DEBUG(d2_to_dns_logger, DBGLVL_TRACE_DETAIL,
+    LOG_DEBUG(d2_to_dns_logger, isc::log::DBGLVL_TRACE_DETAIL,
               DHCP_DDNS_STARTING_TRANSACTION)
               .arg(getRequestId());
 
@@ -98,7 +98,7 @@ NameChangeTransaction::operator()(DNSClient::Status status) {
     // runModel is exception safe so we are good to call it here.
     // It won't exit until we hit the next IO wait or the state model ends.
     setDnsUpdateStatus(status);
-    LOG_DEBUG(d2_to_dns_logger, DBGLVL_TRACE_DETAIL,
+    LOG_DEBUG(d2_to_dns_logger, isc::log::DBGLVL_TRACE_DETAIL,
               DHCP_DDNS_UPDATE_RESPONSE_RECEIVED)
               .arg(getRequestId())
               .arg(current_server_->toText())
@@ -177,7 +177,7 @@ NameChangeTransaction::sendUpdate(const std::string& comment) {
                               d2_params->getDnsServerTimeout(), tsig_key_);
         // Message is on its way, so the next event should be NOP_EVT.
         postNextEvent(NOP_EVT);
-        LOG_DEBUG(d2_to_dns_logger, DBGLVL_TRACE_DETAIL,
+        LOG_DEBUG(d2_to_dns_logger, isc::log::DBGLVL_TRACE_DETAIL,
                   DHCP_DDNS_UPDATE_REQUEST_SENT)
                   .arg(getRequestId())
                   .arg(comment)

+ 9 - 9
src/bin/dhcp4/dhcp4_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2015,2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -21,19 +21,19 @@ namespace dhcp {
 //@{
 
 /// @brief Debug level used to log information during server startup.
-const int DBG_DHCP4_START = DBGLVL_START_SHUT;
+const int DBG_DHCP4_START = isc::log::DBGLVL_START_SHUT;
 
 /// @brief Debug level used to log information during server shutdown.
-const int DBG_DHCP4_SHUT = DBGLVL_START_SHUT;
+const int DBG_DHCP4_SHUT = isc::log::DBGLVL_START_SHUT;
 
 /// @brief Debug level used to log receiving commands.
-const int DBG_DHCP4_COMMAND = DBGLVL_COMMAND;
+const int DBG_DHCP4_COMMAND = isc::log::DBGLVL_COMMAND;
 
 /// @brief Debug level used to trace basic operations within the code.
-const int DBG_DHCP4_BASIC = DBGLVL_TRACE_BASIC;
+const int DBG_DHCP4_BASIC = isc::log::DBGLVL_TRACE_BASIC;
 
 /// @brief Debug level used to trace hook related operations
-const int DBG_DHCP4_HOOKS = DBGLVL_TRACE_BASIC;
+const int DBG_DHCP4_HOOKS = isc::log::DBGLVL_TRACE_BASIC;
 
 /// @brief Debug level used to log the traces with some basic data.
 ///
@@ -42,7 +42,7 @@ const int DBG_DHCP4_HOOKS = DBGLVL_TRACE_BASIC;
 /// more detailed information in cases when it is warranted and the
 /// extraction of the data doesn't impact the server's performance
 /// significantly.
-const int DBG_DHCP4_BASIC_DATA = DBGLVL_TRACE_BASIC_DATA;
+const int DBG_DHCP4_BASIC_DATA = isc::log::DBGLVL_TRACE_BASIC_DATA;
 
 /// @brief Debug level used to trace detailed errors.
 ///
@@ -50,10 +50,10 @@ const int DBG_DHCP4_BASIC_DATA = DBGLVL_TRACE_BASIC_DATA;
 /// packets.  (These are not logged at severities of WARN or higher for fear
 /// that a set of deliberately invalid packets set to the server could overwhelm
 /// the logging.)
-const int DBG_DHCP4_DETAIL = DBGLVL_TRACE_DETAIL;
+const int DBG_DHCP4_DETAIL = isc::log::DBGLVL_TRACE_DETAIL;
 
 /// @brief This level is used to log the contents of packets received and sent.
-const int DBG_DHCP4_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
+const int DBG_DHCP4_DETAIL_DATA = isc::log::DBGLVL_TRACE_DETAIL_DATA;
 
 //@}
 

+ 9 - 9
src/bin/dhcp6/dhcp6_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2015,2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -18,19 +18,19 @@ namespace dhcp {
 //@{
 
 /// @brief Debug level used to log information during server startup.
-const int DBG_DHCP6_START = DBGLVL_START_SHUT;
+const int DBG_DHCP6_START = isc::log::DBGLVL_START_SHUT;
 
 /// @brief Debug level used to log information during server shutdown.
-const int DBG_DHCP6_SHUT = DBGLVL_START_SHUT;
+const int DBG_DHCP6_SHUT = isc::log::DBGLVL_START_SHUT;
 
 /// @brief Debug level used to log receiving commands.
-const int DBG_DHCP6_COMMAND = DBGLVL_COMMAND;
+const int DBG_DHCP6_COMMAND = isc::log::DBGLVL_COMMAND;
 
 /// @brief Debug level used to trace basic operations within the code.
-const int DBG_DHCP6_BASIC = DBGLVL_TRACE_BASIC;
+const int DBG_DHCP6_BASIC = isc::log::DBGLVL_TRACE_BASIC;
 
 /// @brief Debug level used to trace hook related operations
-const int DBG_DHCP6_HOOKS = DBGLVL_TRACE_BASIC;
+const int DBG_DHCP6_HOOKS = isc::log::DBGLVL_TRACE_BASIC;
 
 /// @brief Debug level used to log the traces with some basic data.
 ///
@@ -39,7 +39,7 @@ const int DBG_DHCP6_HOOKS = DBGLVL_TRACE_BASIC;
 /// more detailed information in cases when it is warranted and the
 /// extraction of the data doesn't impact the server's performance
 /// significantly.
-const int DBG_DHCP6_BASIC_DATA = DBGLVL_TRACE_BASIC_DATA;
+const int DBG_DHCP6_BASIC_DATA = isc::log::DBGLVL_TRACE_BASIC_DATA;
 
 /// @brief Debug level used to trace detailed errors.
 ///
@@ -47,10 +47,10 @@ const int DBG_DHCP6_BASIC_DATA = DBGLVL_TRACE_BASIC_DATA;
 /// packets.  (These are not logged at severities of WARN or higher for fear
 /// that a set of deliberately invalid packets set to the server could overwhelm
 /// the logging.)
-const int DBG_DHCP6_DETAIL = DBGLVL_TRACE_DETAIL;
+const int DBG_DHCP6_DETAIL = isc::log::DBGLVL_TRACE_DETAIL;
 
 /// @brief This level is used to log the contents of packets received and sent.
-const int DBG_DHCP6_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
+const int DBG_DHCP6_DETAIL_DATA = isc::log::DBGLVL_TRACE_DETAIL_DATA;
 
 //@}
 

+ 2 - 2
src/lib/config/config_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015,2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -21,7 +21,7 @@ namespace config {
 extern isc::log::Logger command_logger;
 
 // Enumerate configuration elements as they are processed.
-const int DBG_COMMAND = DBGLVL_COMMAND;
+const int DBG_COMMAND = isc::log::DBGLVL_COMMAND;
 
 } // namespace config
 } // namespace isc

+ 2 - 2
src/lib/dhcp_ddns/ncr_udp.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -174,7 +174,7 @@ NameChangeUDPListener::receiveCompletionHandler(const bool successful,
         if (error_code.value() == boost::asio::error::operation_aborted) {
             // A shutdown cancels all outstanding reads.  For this reason,
             // it can be an expected event, so log it as a debug message.
-            LOG_DEBUG(dhcp_ddns_logger, DBGLVL_TRACE_BASIC,
+            LOG_DEBUG(dhcp_ddns_logger, isc::log::DBGLVL_TRACE_BASIC,
                       DHCP_DDNS_NCR_UDP_RECV_CANCELED);
             result = STOPPED;
         } else {

+ 5 - 5
src/lib/dhcpsrv/alloc_engine_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015,2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -19,23 +19,23 @@ namespace dhcp {
 /// Defines the levels used to output debug messages from the @c AllocEngine.
 
 /// @brief Traces normal operations
-const int ALLOC_ENGINE_DBG_TRACE = DBGLVL_TRACE_BASIC;
+const int ALLOC_ENGINE_DBG_TRACE = isc::log::DBGLVL_TRACE_BASIC;
 
 /// @brief Records the results of various operations.
 ///
 /// Messages logged at this level will typically contain summary of the
 /// data retrieved.
-const int ALLOC_ENGINE_DBG_RESULTS = DBGLVL_TRACE_BASIC_DATA;
+const int ALLOC_ENGINE_DBG_RESULTS = isc::log::DBGLVL_TRACE_BASIC_DATA;
 
 /// @brief Record detailed traces
 ///
 /// Messages logged at this level will log detailed tracing information.
-const int ALLOC_ENGINE_DBG_TRACE_DETAIL = DBGLVL_TRACE_DETAIL;
+const int ALLOC_ENGINE_DBG_TRACE_DETAIL = isc::log::DBGLVL_TRACE_DETAIL;
 
 /// @brief Records detailed results of various operations.
 ///
 /// Messages logged at this level will contain detailed results.
-const int ALLOC_ENGINE_DBG_TRACE_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
+const int ALLOC_ENGINE_DBG_TRACE_DETAIL_DATA = isc::log::DBGLVL_TRACE_DETAIL_DATA;
 
 //@}
 

+ 6 - 6
src/lib/dhcpsrv/dhcpsrv_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015,2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -23,27 +23,27 @@ namespace dhcp {
 /// @brief Traces normal operations
 ///
 /// E.g. sending a query to the database etc.
-const int DHCPSRV_DBG_TRACE = DBGLVL_TRACE_BASIC;
+const int DHCPSRV_DBG_TRACE = isc::log::DBGLVL_TRACE_BASIC;
 
 /// @brief Records the results of the lookups
 ///
 /// Using the example of tracing queries from the backend database, this will
 /// just record the summary results.
-const int DHCPSRV_DBG_RESULTS = DBGLVL_TRACE_BASIC_DATA;
+const int DHCPSRV_DBG_RESULTS = isc::log::DBGLVL_TRACE_BASIC_DATA;
 
 /// @brief Additional information
 ///
 /// Record detailed tracing. This is generally reserved for tracing access to
 /// the lease database.
-const int DHCPSRV_DBG_TRACE_DETAIL = DBGLVL_TRACE_DETAIL;
+const int DHCPSRV_DBG_TRACE_DETAIL = isc::log::DBGLVL_TRACE_DETAIL;
 
 /// @brief Additional information
 ///
 /// Record detailed (and verbose) data on the server.
-const int DHCPSRV_DBG_TRACE_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
+const int DHCPSRV_DBG_TRACE_DETAIL_DATA = isc::log::DBGLVL_TRACE_DETAIL_DATA;
 
 // Trace hook related operations
-const int DHCPSRV_DBG_HOOKS = DBGLVL_TRACE_BASIC;
+const int DHCPSRV_DBG_HOOKS = isc::log::DBGLVL_TRACE_BASIC;
 
 ///@}
 

+ 5 - 5
src/lib/dhcpsrv/hosts_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015,2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -24,23 +24,23 @@ namespace dhcp {
 ///
 /// An example of the normal operation is the call to one of the functions
 /// which retrieve the reservations or add new reservation.
-const int HOSTS_DBG_TRACE = DBGLVL_TRACE_BASIC;
+const int HOSTS_DBG_TRACE = isc::log::DBGLVL_TRACE_BASIC;
 
 /// @brief Records the results of the lookups
 ///
 /// Messages logged at this level will typically contain summary of the
 /// data retrieved.
-const int HOSTS_DBG_RESULTS = DBGLVL_TRACE_BASIC_DATA;
+const int HOSTS_DBG_RESULTS = isc::log::DBGLVL_TRACE_BASIC_DATA;
 
 /// @brief Record detailed traces
 ///
 /// Messages logged at this level will log detailed tracing information.
-const int HOSTS_DBG_TRACE_DETAIL = DBGLVL_TRACE_DETAIL;
+const int HOSTS_DBG_TRACE_DETAIL = isc::log::DBGLVL_TRACE_DETAIL;
 
 /// @brief Records detailed results of lookups.
 ///
 /// Messages logged at this level will contain detailed results.
-const int HOSTS_DBG_TRACE_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
+const int HOSTS_DBG_TRACE_DETAIL_DATA = isc::log::DBGLVL_TRACE_DETAIL_DATA;
 
 ///@}
 

+ 3 - 3
src/lib/eval/eval_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -19,11 +19,11 @@ namespace dhcp {
 /// Note that higher numbers equate to more verbose (and detailed) output.
 
 // The first level traces normal operations,
-const int EVAL_DBG_TRACE = DBGLVL_TRACE_BASIC;
+const int EVAL_DBG_TRACE = isc::log::DBGLVL_TRACE_BASIC;
 
 // Additional information on the calls.  Report the values that were
 // popped from or pushed to the value stack.
-const int EVAL_DBG_STACK = DBGLVL_TRACE_DETAIL_DATA;
+const int EVAL_DBG_STACK = isc::log::DBGLVL_TRACE_DETAIL_DATA;
 
 /// @brief Eval Logger
 ///

+ 4 - 4
src/lib/hooks/hooks_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015,2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -19,14 +19,14 @@ namespace hooks {
 /// Note that higher numbers equate to more verbose (and detailed) output.
 
 // The first level traces normal operations,
-const int HOOKS_DBG_TRACE = DBGLVL_TRACE_BASIC;
+const int HOOKS_DBG_TRACE = isc::log::DBGLVL_TRACE_BASIC;
 
 // The next level traces each call to hook code.
-const int HOOKS_DBG_CALLS = DBGLVL_TRACE_BASIC_DATA;
+const int HOOKS_DBG_CALLS = isc::log::DBGLVL_TRACE_BASIC_DATA;
 
 // Additional information on the calls.  Report each call to a callout (even
 // if there are multiple callouts on a hook) and each status return.
-const int HOOKS_DBG_EXTENDED_CALLS = DBGLVL_TRACE_DETAIL_DATA;
+const int HOOKS_DBG_EXTENDED_CALLS = isc::log::DBGLVL_TRACE_DETAIL_DATA;
 
 
 /// @brief Hooks Logger

+ 12 - 6
src/lib/http/connection.cc

@@ -60,7 +60,8 @@ HttpConnection::close() {
 void
 HttpConnection::stopThisConnection() {
     try {
-        LOG_DEBUG(http_logger, DBGLVL_TRACE_BASIC, HTTP_CONNECTION_STOP)
+        LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_BASIC,
+                  HTTP_CONNECTION_STOP)
             .arg(getRemoteEndpointAddressAsText());
         connection_pool_.stop(shared_from_this());
     } catch (...) {
@@ -128,7 +129,8 @@ HttpConnection::acceptorCallback(const boost::system::error_code& ec) {
     acceptor_callback_(ec);
 
     if (!ec) {
-        LOG_DEBUG(http_logger, DBGLVL_TRACE_DETAIL, HTTP_REQUEST_RECEIVE_START)
+        LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_DETAIL,
+                  HTTP_REQUEST_RECEIVE_START)
             .arg(getRemoteEndpointAddressAsText())
             .arg(static_cast<unsigned>(request_timeout_/1000));
         request_timer_.setup(boost::bind(&HttpConnection::requestTimeoutCallback, this),
@@ -140,7 +142,8 @@ HttpConnection::acceptorCallback(const boost::system::error_code& ec) {
 void
 HttpConnection::socketReadCallback(boost::system::error_code, size_t length) {
     if (length != 0) {
-        LOG_DEBUG(http_logger, DBGLVL_TRACE_DETAIL_DATA, HTTP_DATA_RECEIVED)
+        LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_DETAIL_DATA,
+                  HTTP_DATA_RECEIVED)
             .arg(length)
             .arg(getRemoteEndpointAddressAsText());
     }
@@ -151,7 +154,8 @@ HttpConnection::socketReadCallback(boost::system::error_code, size_t length) {
         doRead();
 
     } else {
-        LOG_DEBUG(http_logger, DBGLVL_TRACE_DETAIL, HTTP_REQUEST_RECEIVED)
+        LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_DETAIL,
+                  HTTP_REQUEST_RECEIVED)
             .arg(getRemoteEndpointAddressAsText());
         try {
             request_->finalize();
@@ -159,7 +163,8 @@ HttpConnection::socketReadCallback(boost::system::error_code, size_t length) {
         }
 
         HttpResponsePtr response = response_creator_->createHttpResponse(request_);
-        LOG_DEBUG(http_logger, DBGLVL_TRACE_DETAIL, HTTP_RESPONSE_SEND)
+        LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_DETAIL,
+                  HTTP_RESPONSE_SEND)
             .arg(response->toBriefString())
             .arg(getRemoteEndpointAddressAsText());
         asyncSendResponse(response);
@@ -181,7 +186,8 @@ HttpConnection::socketWriteCallback(boost::system::error_code,
 
 void
 HttpConnection::requestTimeoutCallback() {
-    LOG_DEBUG(http_logger, DBGLVL_TRACE_DETAIL, HTTP_REQUEST_TIMEOUT_OCCURRED)
+    LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_DETAIL,
+              HTTP_REQUEST_TIMEOUT_OCCURRED)
         .arg(getRemoteEndpointAddressAsText());
     HttpResponsePtr response =
         response_creator_->createStockHttpResponse(request_,

+ 1 - 1
src/lib/log/Makefile.am

@@ -9,7 +9,7 @@ CLEANFILES = *.gcno *.gcda
 lib_LTLIBRARIES = libkea-log.la
 libkea_log_la_SOURCES  =
 libkea_log_la_SOURCES += logimpl_messages.cc logimpl_messages.h
-libkea_log_la_SOURCES += log_dbglevels.h
+libkea_log_la_SOURCES += log_dbglevels.cc log_dbglevels.h
 libkea_log_la_SOURCES += log_formatter.h log_formatter.cc
 libkea_log_la_SOURCES += logger.cc logger.h
 libkea_log_la_SOURCES += logger_impl.cc logger_impl.h

+ 22 - 0
src/lib/log/log_dbglevels.cc

@@ -0,0 +1,22 @@
+// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+namespace isc {
+namespace log {
+
+/// This is given a value of 0 as that is the level selected if debugging is
+/// enabled without giving a level.
+extern const int DBGLVL_START_SHUT = 0;
+extern const int DBGLVL_COMMAND = 10;
+extern const int DBGLVL_COMMAND_DATA = 20;
+
+extern const int DBGLVL_TRACE_BASIC = 40;
+extern const int DBGLVL_TRACE_BASIC_DATA = 45;
+extern const int DBGLVL_TRACE_DETAIL = 50;
+extern const int DBGLVL_TRACE_DETAIL_DATA = 55;
+
+}
+}

+ 12 - 13
src/lib/log/log_dbglevels.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -38,7 +38,8 @@
 /// enabling debugging.  Symbols are prefixed DBGLVL so as not to clash with
 /// DBG_ symbols in the various modules.
 
-namespace {
+namespace isc {
+namespace log {
 
 /// Process startup/shutdown debug messages.  Note that these are _debug_
 /// messages, as other messages related to startup and shutdown may be output
@@ -46,35 +47,33 @@ namespace {
 /// up, the "server started" message could be output at a severity of INFO.
 /// "Server starting" and messages indicating the stages in startup should be
 /// debug messages output at this severity.
-///
-/// This is given a value of 0 as that is the level selected if debugging is
-/// enabled without giving a level.
-const int DBGLVL_START_SHUT = 0;
+extern const int DBGLVL_START_SHUT;
 
 /// This debug level is reserved for logging the exchange of messages/commands
 /// between processes, including configuration messages.
-const int DBGLVL_COMMAND = 10;
+extern const int DBGLVL_COMMAND;
 
 /// If the commands have associated data, this level is when they are printed.
 /// This includes configuration messages.
-const int DBGLVL_COMMAND_DATA = 20;
+extern const int DBGLVL_COMMAND_DATA;
 
 // The following constants are suggested values for common operations.
 // Depending on the exact nature of the code, modules may or may not use these
 // levels.
 
 /// Trace basic operations.
-const int DBGLVL_TRACE_BASIC = 40;
+extern const int DBGLVL_TRACE_BASIC;
 
 /// Trace data associated with the basic operations.
-const int DBGLVL_TRACE_BASIC_DATA = 45;
+extern const int DBGLVL_TRACE_BASIC_DATA;
 
 /// Trace detailed operations.
-const int DBGLVL_TRACE_DETAIL = 50;
+extern const int DBGLVL_TRACE_DETAIL;
 
 /// Trace data associated with detailed operations.
-const int DBGLVL_TRACE_DETAIL_DATA = 55;
+extern const int DBGLVL_TRACE_DETAIL_DATA;
 
-}   // Anonymous namespace
+}   // log namespace
+}   // isc namespace
 
 #endif // LOG_DBGLVLS_H

+ 2 - 2
src/lib/process/d_cfg_mgr.cc

@@ -124,7 +124,7 @@ DCfgMgrBase::setContext(DCfgContextBasePtr& context) {
 isc::data::ConstElementPtr
 DCfgMgrBase::parseConfig(isc::data::ConstElementPtr config_set,
                          bool check_only) {
-    LOG_DEBUG(dctl_logger, DBGLVL_COMMAND,
+    LOG_DEBUG(dctl_logger, isc::log::DBGLVL_COMMAND,
                 DCTL_CONFIG_START).arg(config_set->str());
 
     if (!config_set) {
@@ -280,7 +280,7 @@ DCfgMgrBase::simpleParseConfig(isc::data::ConstElementPtr config_set,
         return (isc::config::createAnswer(1,
                                     std::string("Can't parse NULL config")));
     }
-    LOG_DEBUG(dctl_logger, DBGLVL_COMMAND,
+    LOG_DEBUG(dctl_logger, isc::log::DBGLVL_COMMAND,
                 DCTL_CONFIG_START).arg(config_set->str());
 
     // The parsers implement data inheritance by directly accessing

+ 7 - 4
src/lib/process/d_controller.cc

@@ -124,7 +124,8 @@ DControllerBase::launch(int argc, char* argv[], const bool test_mode) {
                    "Application Process initialization failed: " << ex.what());
     }
 
-    LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DCTL_STANDALONE).arg(app_name_);
+    LOG_DEBUG(dctl_logger, isc::log::DBGLVL_START_SHUT, DCTL_STANDALONE)
+        .arg(app_name_);
 
     // Step 3 is to load configuration from file.
     int rcode;
@@ -293,7 +294,8 @@ DControllerBase::customOption(int /* option */, char* /*optarg*/)
 
 void
 DControllerBase::initProcess() {
-    LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DCTL_INIT_PROCESS).arg(app_name_);
+    LOG_DEBUG(dctl_logger, isc::log::DBGLVL_START_SHUT, DCTL_INIT_PROCESS)
+        .arg(app_name_);
 
     // Invoke virtual method to instantiate the application process.
     try {
@@ -382,7 +384,8 @@ DControllerBase::configFromFile() {
 
 void
 DControllerBase::runProcess() {
-    LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DCTL_RUN_PROCESS).arg(app_name_);
+    LOG_DEBUG(dctl_logger, isc::log::DBGLVL_START_SHUT, DCTL_RUN_PROCESS)
+        .arg(app_name_);
     if (!process_) {
         // This should not be possible.
         isc_throw(DControllerBaseError, "Process not initialized");
@@ -500,7 +503,7 @@ DControllerBase::processSignal(int signum) {
         case SIGINT:
         case SIGTERM:
         {
-            LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT,
+            LOG_DEBUG(dctl_logger, isc::log::DBGLVL_START_SHUT,
                       DCTL_SHUTDOWN_SIGNAL_RECVD).arg(signum);
             ElementPtr arg_set;
             shutdownHandler(SHUT_DOWN_COMMAND, arg_set);