BIND 10 trac745, updated. 04f7331a44e0bfd48f52d06f6fd463c6652dd38f [trac745] Add mode logging statements
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Apr 28 15:01:53 UTC 2011
The branch, trac745 has been updated
via 04f7331a44e0bfd48f52d06f6fd463c6652dd38f (commit)
via 5b4feea19e2cc1bdf18ce52cf0062828ad9067c7 (commit)
from 1ce2874170c85de79a896b1cc3077d9f3032d9e0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 04f7331a44e0bfd48f52d06f6fd463c6652dd38f
Author: Stephen Morris <stephen at isc.org>
Date: Thu Apr 28 15:28:33 2011 +0100
[trac745] Add mode logging statements
commit 5b4feea19e2cc1bdf18ce52cf0062828ad9067c7
Author: Stephen Morris <stephen at isc.org>
Date: Thu Apr 28 15:27:39 2011 +0100
[trac745] Move logging initialization code to logger directory
... the logical place for it.
-----------------------------------------------------------------------
Summary of changes:
src/lib/log/logger_support.cc | 72 ++++++++++++++++++++
src/lib/log/logger_support.h | 31 +++++++++
src/lib/nsas/Makefile.am | 6 +-
src/lib/nsas/nameserver_address_store.cc | 11 +--
src/lib/nsas/nameserver_entry.cc | 26 ++++++-
src/lib/nsas/nsas_levels.h | 25 -------
.../version.h => src/lib/nsas/nsas_log.cc | 12 ++--
src/lib/nsas/nsas_log.h | 53 ++++++++++++++
src/lib/nsas/nsasdef.msg | 45 +++++++++++-
src/lib/nsas/tests/run_unittests.cc | 57 +---------------
10 files changed, 232 insertions(+), 106 deletions(-)
delete mode 100644 src/lib/nsas/nsas_levels.h
copy tests/tools/badpacket/version.h => src/lib/nsas/nsas_log.cc (83%)
create mode 100644 src/lib/nsas/nsas_log.h
-----------------------------------------------------------------------
diff --git a/src/lib/log/logger_support.cc b/src/lib/log/logger_support.cc
index f8bf075..d1e215b 100644
--- a/src/lib/log/logger_support.cc
+++ b/src/lib/log/logger_support.cc
@@ -25,6 +25,7 @@
/// the logging parameters from the configuration database.
#include <algorithm>
+#include <iostream>
#include <string>
#include <vector>
#include <boost/lexical_cast.hpp>
@@ -128,5 +129,76 @@ initLogger(const string& root, isc::log::Severity severity, int dbglevel,
}
}
+/// Logger Run-Time Initialization via Environment Variables
+void initLogger() {
+
+ // Root logger name is defined by the environment variable B10_LOGGER_ROOT.
+ // If not present, the name is "b10root".
+ const char* DEFAULT_ROOT = "b10root";
+ const char* root = getenv("B10_LOGGER_ROOT");
+ if (! root) {
+ root = DEFAULT_ROOT;
+ }
+
+ // Set the logging severity. The environment variable is
+ // B10_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.
+ isc::log::Severity severity = isc::log::DEFAULT;
+ const char* sev_char = getenv("B10_LOGGER_SEVERITY");
+ if (sev_char) {
+ string sev_string(sev_char);
+ if (sev_string == "DEBUG") {
+ severity = isc::log::DEBUG;
+ } else if (sev_string == "INFO") {
+ severity = isc::log::INFO;
+ } else if (sev_string == "WARN") {
+ severity = isc::log::WARN;
+ } else if (sev_string == "ERROR") {
+ severity = isc::log::ERROR;
+ } else if (sev_string == "FATAL") {
+ severity = isc::log::FATAL;
+ } else {
+ std::cerr << "**ERROR** unrecognised logger severity of '"
+ << sev_string << "' - default severity will be used\n";
+ }
+ }
+
+ // If the severity is debug, get the debug level (environment variable
+ // B10_LOGGER_DBGLEVEL), which should be in the range 0 to 99.
+ int dbglevel = 0;
+ if (severity == isc::log::DEBUG) {
+ const char* dbg_char = getenv("B10_LOGGER_DBGLEVEL");
+ if (dbg_char) {
+ int level = 0;
+ try {
+ level = boost::lexical_cast<int>(dbg_char);
+ if (level < MIN_DEBUG_LEVEL) {
+ std::cerr << "**ERROR** debug level of " << level
+ << " is invalid - a value of " << MIN_DEBUG_LEVEL
+ << " will be used\n";
+ level = MIN_DEBUG_LEVEL;
+ } else if (level > MAX_DEBUG_LEVEL) {
+ std::cerr << "**ERROR** debug level of " << level
+ << " is invalid - a value of " << MAX_DEBUG_LEVEL
+ << " will be used\n";
+ level = MAX_DEBUG_LEVEL;
+ }
+ } 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";
+ }
+ dbglevel = level;
+ }
+ }
+
+ /// Set the local message file
+ const char* localfile = getenv("B10_LOGGER_LOCALMSG");
+
+ // Initialize logging
+ initLogger(root, severity, dbglevel, localfile);
+}
+
} // namespace log
} // namespace isc
diff --git a/src/lib/log/logger_support.h b/src/lib/log/logger_support.h
index 6b5fdec..f4861b2 100644
--- a/src/lib/log/logger_support.h
+++ b/src/lib/log/logger_support.h
@@ -39,6 +39,37 @@ namespace log {
void initLogger(const std::string& root, isc::log::Severity severity,
int dbglevel, const char* file);
+
+/// \brief Run-Time Initialization from Environment
+///
+/// Performs run-time initialization of the logger via the setting of
+/// environment variables. These are:
+///
+/// B10_LOGGER_ROOT
+/// Name of the root logger. If not given, the string "b10root" will be used.
+///
+/// B10_LOGGER_SEVERITY
+/// Severity of messages that will be logged. This must be one of the strings
+/// "DEBUG", "INFO", "WARN", "ERROR", "FATAL". (Must be upper case and must
+/// not contain leading or trailing spaces.) If not specified (or if
+/// specified but incorrect), the default for the logging system will be used
+/// (currently INFO).
+///
+/// B10_LOGGER_DBGLEVEL
+/// 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, a value of 0 is used.
+///
+/// B10_LOGGER_LOCALMSG
+/// If defined, the path specification of a file that contains message
+/// definitions replacing ones in the default dictionary.
+///
+/// Any errors in the settings cause messages to be output to stderr.
+///
+/// This function is most likely to be called from unit test programs.
+
+void initLogger();
+
} // namespace log
} // namespace isc
diff --git a/src/lib/nsas/Makefile.am b/src/lib/nsas/Makefile.am
index dcc021d..c5a0da9 100644
--- a/src/lib/nsas/Makefile.am
+++ b/src/lib/nsas/Makefile.am
@@ -26,7 +26,8 @@ nsasdef.h nsasdef.cc: nsasdef.msg
$(top_builddir)/src/lib/log/compiler/message nsasdef.msg
lib_LTLIBRARIES = libnsas.la
-libnsas_la_SOURCES = address_entry.h address_entry.cc
+libnsas_la_SOURCES = nsasdef.h nsasdef.cc
+libnsas_la_SOURCES += address_entry.h address_entry.cc
libnsas_la_SOURCES += asiolink.h
libnsas_la_SOURCES += hash.cc hash.h
libnsas_la_SOURCES += hash_deleter.h
@@ -35,10 +36,9 @@ libnsas_la_SOURCES += hash_table.h
libnsas_la_SOURCES += nameserver_address_store.cc nameserver_address_store.h
libnsas_la_SOURCES += nameserver_address.h nameserver_address.cc
libnsas_la_SOURCES += nameserver_entry.cc nameserver_entry.h
-libnsas_la_SOURCES += nsasdef.h nsasdef.cc
libnsas_la_SOURCES += nsas_entry_compare.h
libnsas_la_SOURCES += nsas_entry.h nsas_types.h
-libnsas_la_SOURCES += nsas_levels.h
+libnsas_la_SOURCES += nsas_log.cc nsas_log.h
libnsas_la_SOURCES += zone_entry.cc zone_entry.h
libnsas_la_SOURCES += fetchable.h
libnsas_la_SOURCES += address_request_callback.h
diff --git a/src/lib/nsas/nameserver_address_store.cc b/src/lib/nsas/nameserver_address_store.cc
index 816ad8f..a12bc02 100644
--- a/src/lib/nsas/nameserver_address_store.cc
+++ b/src/lib/nsas/nameserver_address_store.cc
@@ -33,7 +33,7 @@
#include "glue_hints.h"
#include "address_request_callback.h"
#include "nsasdef.h"
-#include "nsas_levels.h"
+#include "nsas_log.h"
using namespace isc::dns;
using namespace std;
@@ -41,11 +41,6 @@ using namespace std;
namespace isc {
namespace nsas {
-// Define logger for messages (local to this file)
-namespace {
-isc::log::Logger logger("nsas");
-}
-
// Constructor.
//
// The LRU lists are set equal to three times the size of the respective
@@ -92,7 +87,7 @@ NameserverAddressStore::lookup(const string& zone, const RRClass& class_code,
boost::shared_ptr<AddressRequestCallback> callback, AddressFamily family,
const GlueHints& glue_hints)
{
- logger.debug(NSAS_DBG_TRACE, NSAS_LOOKUPZONE, zone.c_str());
+ nsas_logger.debug(NSAS_DBG_TRACE, NSAS_LOOKUPZONE, zone.c_str());
pair<bool, boost::shared_ptr<ZoneEntry> > zone_obj(
zone_hash_->getOrAdd(HashKey(zone, class_code),
@@ -113,7 +108,7 @@ NameserverAddressStore::cancel(const string& zone,
const boost::shared_ptr<AddressRequestCallback>& callback,
AddressFamily family)
{
- logger.debug(NSAS_DBG_TRACE, NSAS_LOOKUPCANCEL, zone.c_str());
+ nsas_logger.debug(NSAS_DBG_TRACE, NSAS_LOOKUPCANCEL, zone.c_str());
boost::shared_ptr<ZoneEntry> entry(zone_hash_->get(HashKey(zone,
class_code)));
diff --git a/src/lib/nsas/nameserver_entry.cc b/src/lib/nsas/nameserver_entry.cc
index 4035f79..f491cdc 100644
--- a/src/lib/nsas/nameserver_entry.cc
+++ b/src/lib/nsas/nameserver_entry.cc
@@ -40,6 +40,7 @@
#include "address_entry.h"
#include "nameserver_address.h"
#include "nameserver_entry.h"
+#include "nsas_log.h"
using namespace isc::asiolink;
using namespace isc::nsas;
@@ -178,6 +179,9 @@ NameserverEntry::updateAddressRTTAtIndex(uint32_t rtt, size_t index,
new_rtt = 1;
}
addresses_[family][index].setRTT(new_rtt);
+ nsas_logger.debug(NSAS_DBG_RTT, NSAS_SETRTT,
+ addresses_[family][index].getAddress().toText().c_str(),
+ old_rtt, new_rtt);
}
void
@@ -203,7 +207,7 @@ NameserverEntry::setAddressUnreachable(const IOAddress& address) {
* \short A callback into the resolver.
*
* Whenever we ask the resolver something, this is created and the answer is
- * fed back trough this. It holds a shared pointer to the entry so it is not
+ * fed back through this. It holds a shared pointer to the entry so it is not
* destroyed too soon.
*/
class NameserverEntry::ResolverCallback :
@@ -230,6 +234,7 @@ class NameserverEntry::ResolverCallback :
if (!response_message ||
response_message->getRcode() != isc::dns::Rcode::NOERROR() ||
response_message->getRRCount(isc::dns::Message::SECTION_ANSWER) == 0) {
+ nsas_logger.error(NSAS_INVRESPSTR, entry_->getName().c_str());
failureInternal(lock);
return;
}
@@ -243,7 +248,13 @@ class NameserverEntry::ResolverCallback :
if (response->getType() != type_ ||
response->getClass() != RRClass(entry_->getClass()))
{
- // TODO Log we got answer of different type
+ // Invalid response type or class
+ nsas_logger.error(NSAS_INVRESPTC, entry_->getName().c_str(),
+ type_.toText().c_str(),
+ RRClass(entry_->getClass()).toText().c_str(),
+ response->getType().toText().c_str(),
+ response->getClass().toText().c_str());
+
failureInternal(lock);
return;
}
@@ -264,8 +275,10 @@ class NameserverEntry::ResolverCallback :
}
}
// If we found it, use it. If not, create a new one.
- entries.push_back(found ? *found : AddressEntry(IOAddress(
- i->getCurrent().toText()), 1));
+ entries.push_back(found ? *found : AddressEntry(
+ IOAddress(address), 1));
+ nsas_logger.debug(NSAS_DBG_RESULTS, NSAS_NSLKUPSUCC,
+ address.c_str(), entry_->getName().c_str());
}
// We no longer need the previous set of addresses, we have
@@ -310,6 +323,9 @@ class NameserverEntry::ResolverCallback :
* So mark the current address family as unreachable.
*/
virtual void failure() {
+ nsas_logger.debug(NSAS_DBG_RESULTS, NSAS_NSLKUPFAIL,
+ type_.toText().c_str(),
+ entry_->getName().c_str());
Lock lock(entry_->mutex_);
failureInternal(lock);
}
@@ -422,6 +438,8 @@ NameserverEntry::askIP(isc::resolve::ResolverInterface* resolver,
// Ask for both types of addresses
// We are unlocked here, as the callback from that might want to lock
lock.unlock();
+
+ nsas_logger.debug(NSAS_DBG_TRACE, NSAS_NSADDR, getName().c_str());
askIP(resolver, RRType::A(), V4_ONLY);
askIP(resolver, RRType::AAAA(), V6_ONLY);
// Make sure we end the routine when we are not locked
diff --git a/src/lib/nsas/nsas_levels.h b/src/lib/nsas/nsas_levels.h
deleted file mode 100644
index 3688443..0000000
--- a/src/lib/nsas/nsas_levels.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
-//
-// Permission to use, copy, modify, and/or distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-// PERFORMANCE OF THIS SOFTWARE.
-
-#ifndef __NSAS_LEVELS_H
-#define __NSAS_LEVELS_H
-
-/// \brief NSAS Debug Levels
-///
-/// Defines the levels used to output debug messages in the NSAS. Note that
-/// higher numbers equate to more verbose (and detailed) output.
-
-const int NSAS_DBG_TRACE = 10; // Trace of normal operations
-
-#endif // __NSAS_LEVELS_H
diff --git a/src/lib/nsas/nsas_log.cc b/src/lib/nsas/nsas_log.cc
new file mode 100644
index 0000000..931b131
--- /dev/null
+++ b/src/lib/nsas/nsas_log.cc
@@ -0,0 +1,26 @@
+// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+/// Defines the logger used by the NSAS
+
+#include "nsas/nsas_log.h"
+
+namespace isc {
+namespace nsas {
+
+isc::log::Logger nsas_logger("nsas");
+
+} // namespace nsas
+} // namespace isc
+
diff --git a/src/lib/nsas/nsas_log.h b/src/lib/nsas/nsas_log.h
new file mode 100644
index 0000000..cd831de
--- /dev/null
+++ b/src/lib/nsas/nsas_log.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __NSAS_LOG__H
+#define __NSAS_LOG__H
+
+#include <log/logger.h>
+#include "nsasdef.h"
+
+namespace isc {
+namespace nsas {
+
+/// \brief NSAS Logging
+///
+/// Defines the levels used to output debug messages in the NSAS. Note that
+/// higher numbers equate to more verbose (and detailed) output.
+
+// The first level traces normal operations - asking the NSAS for an address,
+// and cancelling a lookup. It also records when the NSAS calls back to the
+// resolver to resolve something.
+const int NSAS_DBG_TRACE = 10;
+
+// The next level extends the normal operations and records the results of the
+// lookups.
+const int NSAS_DBG_RESULTS = 20;
+
+// Additional information on the usage of the names - the RTT values obtained
+// when queries were done.
+const int NSAS_DBG_RTT = 30;
+
+
+/// \brief NSAS Logger
+///
+/// Define the logger used to log messages. We could define it in multiple
+/// modules, but defining in a single module and linking to it saves time and
+/// space.
+extern isc::log::Logger nsas_logger; // isc::nsas::logger is the NSAS logger
+
+} // namespace nsas
+} // namespace isc
+
+#endif // __NSAS_LOG__H
diff --git a/src/lib/nsas/nsasdef.msg b/src/lib/nsas/nsasdef.msg
index bfcdd21..89b8fe8 100644
--- a/src/lib/nsas/nsasdef.msg
+++ b/src/lib/nsas/nsasdef.msg
@@ -15,10 +15,47 @@
$PREFIX NSAS_
$NAMESPACE isc::nsas
+INVRESPSTR queried for %s but got invalid response
++ This message indicates an internal error in the nameserver address store
++ component (NSAS) of the resolver. The NSAS made a query for a RR for the
++ specified nameserver but received an invalid response. Either the success
++ function was called without a DNS message or the message was invalid on some
++ way. (In the latter case, the error should have been picked up elsewhere in
++ the processing logic, hence the raising of the error here.)
+
+INVRESPTC queried for %s RR of type/class %s/%s, received response %s/%s
++ This message indicates an internal error in the nameserver address store
++ component (NSAS) of the resolver. The NSAS made a query for the given RR
++ type and class, but instead received an answer with the given type and class.
+
LOOKUPCANCEL lookup for zone %s has been cancelled
-+ A debug message, this is output when a NSAS lookup for a zone has been
-+ cancelled.
++ A debug message, this is output when a NSAS (nameserver address store -
++ part of the resolver) lookup for a zone has been + cancelled.
LOOKUPZONE searching NSAS for nameservers for zone %s
-+ A debug message, this is output when a call is made to the NSAS to obtain
-+ the nameservers for the specified zone.
++ A debug message, this is output when a call is made to the nameserver address
++ store (part of the resolver) to obtain the nameservers for the specified zone.
+
+NSADDR asking resolver to obtain A and AAAA records for %s
++ A debug message, the NSAS (nameserver address store - part of the resolver) is
++ making a callback into the resolver to retrieve the address records for the
++ specified nameserver.
+
+NSLKUPFAIL failed to lookup any %s for %s
++ A debug message, the NSAS (nameserver address store - part of the resolver)
++ has been unable to retrieve the specified resource record for the specified
++ nameserver. This is not necessarily a problem - the nameserver may be
++ unreachable, in which case the NSAS will try other nameservers in the zone.
+
+NSLKUPSUCC found address %s for %s
++ A debug message, the NSAS (nameserver address store - part of the resolver)
++ has retrieved the given address for the specified nameserver through an
++ external query.
+
+SETRTT reporting RTT for %s as %d; new value is now %d
++ A NSAS (nameserver address store - part of the resolver) debug message
++ reporting the round-trip time (RTT) for a query made to the specified
++ nameserver. The RTT has been updated using the value given and the new RTT is
++ displayed. (The RTT is subject to a calculation that damps out sudden
++ changes. As a result, the new RTT is not necessarily equal to the RTT
++ reported.)
diff --git a/src/lib/nsas/tests/run_unittests.cc b/src/lib/nsas/tests/run_unittests.cc
index 299c48c..bc672d0 100644
--- a/src/lib/nsas/tests/run_unittests.cc
+++ b/src/lib/nsas/tests/run_unittests.cc
@@ -25,66 +25,11 @@
using namespace std;
-// Initialize the logging.
-void init_logging() {
-
- const char* DEFAULT_ROOT = "b10root";
-
- // Root logger name is defined by the environment variable B10_LOGGER_ROOT.
- // If not present, the name is "b10root".
- const char* root = getenv("B10_LOGGER_ROOT");
- if (! root) {
- root = DEFAULT_ROOT;
- }
-
- // Set the logging severity. The environment variable is
- // B10_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.
- isc::log::Severity severity = isc::log::DEFAULT;
- const char* sev_char = getenv("B10_LOGGER_SEVERITY");
- if (sev_char) {
- string sev_string(sev_char);
- if (sev_string == "DEBUG") {
- severity = isc::log::DEBUG;
- } else if (sev_string == "INFO") {
- severity = isc::log::INFO;
- } else if (sev_string == "WARN") {
- severity = isc::log::WARN;
- } else if (sev_string == "ERROR") {
- severity = isc::log::ERROR;
- } else if (sev_string == "FATAL") {
- severity = isc::log::FATAL;
- }
- }
-
- // If the severity is debug, get the debug level (environment variable
- // B10_LOGGER_DBGLEVEL), which should be in the range 0 to 99.
- int dbglevel = 0;
- if (severity == isc::log::DEBUG) {
- const char* dbg_char = getenv("B10_LOGGER_DBGLEVEL");
- if (dbg_char) {
- int level = 0;
- try {
- level = boost::lexical_cast<int>(dbg_char);
- } catch (...) {
- // Error, but not fatal to the test
- std::cerr << "***ERROR*** Unable to translate "
- "B10_LOGGER_DBGLEVEL \n";
- }
- dbglevel = level;
- }
- }
-
- // Initialize logging
- isc::log::initLogger(root, severity, dbglevel, NULL);
-}
-
int
main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
- init_logging();
+ isc::log::initLogger();
return (RUN_ALL_TESTS());
}
More information about the bind10-changes
mailing list