Browse Source

More logging messages in merged code

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/vorner-recursor-dummylog@3569 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner 14 years ago
parent
commit
c036dede06
2 changed files with 14 additions and 4 deletions
  1. 1 0
      src/bin/recurse/main.cc
  2. 13 4
      src/bin/recurse/recursor.cc

+ 1 - 0
src/bin/recurse/main.cc

@@ -165,6 +165,7 @@ main(int argc, char* argv[]) {
 
         recursor->setConfigSession(config_session);
         recursor->updateConfig(config_session->getFullConfig());
+        dlog("Config loaded");
 
         dlog("Server started.");
         io_service.run();

+ 13 - 4
src/bin/recurse/recursor.cc

@@ -90,9 +90,14 @@ public:
         upstream_ = upstream;
         if (dnss) {
             if (upstream_.empty()) {
-                cerr << "[b10-recurse] Asked to do full recursive," << endl <<
-                    "but not implemented yet. I'll do nothing." << endl;
+                dlog("Asked to do full recursive, but not implemented yet."
+                    "I'll do nothing.");
             } else {
+                dlog("Setting forward addresses:");
+                BOOST_FOREACH(const addr_t& address, upstream) {
+                    dlog(" " + address.first + ":" +
+                        boost::lexical_cast<string>(address.second));
+                }
                 querySetup(*dnss);
             }
         }
@@ -530,6 +535,10 @@ setAddresses(DNSService *service, const vector<addr_t>& addresses) {
 void
 Recursor::setListenAddresses(const vector<addr_t>& addresses) {
     try {
+        dlog("Setting listen addresses:");
+        BOOST_FOREACH(const addr_t& addr, addresses) {
+            dlog(" " + addr.first + boost::lexical_cast<string>(addr.second));
+        }
         setAddresses(dnss_, addresses);
         impl_->listen_ = addresses;
     }
@@ -545,8 +554,8 @@ Recursor::setListenAddresses(const vector<addr_t>& addresses) {
             setAddresses(dnss_, impl_->listen_);
         }
         catch (const exception& e2) {
-            cerr << "[b10-recurse] Unable to recover from error: " << e.what()
-                << endl << "Rollback failed with: " << e2.what() << endl;
+            dlog("Unable to recover from error: " + e.what() +
+                "Rollback failed with: " + e2.what());
             abort();
         }
         throw e; // Let it fly a little bit further