]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
don't use toString() for logging
authorKees Monshouwer <mind04@monshouwer.org>
Mon, 20 Nov 2017 19:30:24 +0000 (20:30 +0100)
committermind04 <mind04@monshouwer.org>
Mon, 20 Nov 2017 19:30:24 +0000 (20:30 +0100)
pdns/reczones.cc
pdns/rpzloader.cc
pdns/syncres.cc
pdns/test-dnsname_cc.cc
pdns/tsig-tests.cc
pdns/validate.cc

index b0ac82748f09bc955afce0e1fe1cba32c544fe1a..9c1afd1107cd0d855a82651cc13662ed1dd1f2b3 100644 (file)
@@ -370,7 +370,7 @@ void RPZIXFRTracker(const ComboAddress& master, const DNSName& zoneName, boost::
        }
        else {
           totremove++;
-         L<<(g_logRPZChanges ? Logger::Info : Logger::Debug)<<"Had removal of "<<rr.d_name<<" from RPZ zone "<<zoneName.toStringNoDot()<<endl;
+         L<<(g_logRPZChanges ? Logger::Info : Logger::Debug)<<"Had removal of "<<rr.d_name<<" from RPZ zone "<<zoneName<<endl;
          RPZRecordToPolicy(rr, newZone, false, defpol, maxTTL);
        }
       }
@@ -387,7 +387,7 @@ void RPZIXFRTracker(const ComboAddress& master, const DNSName& zoneName, boost::
        }
        else {
           totadd++;
-         L<<(g_logRPZChanges ? Logger::Info : Logger::Debug)<<"Had addition of "<<rr.d_name<<" to RPZ zone "<<zoneName.toStringNoDot()<<endl;
+         L<<(g_logRPZChanges ? Logger::Info : Logger::Debug)<<"Had addition of "<<rr.d_name<<" to RPZ zone "<<zoneName<<endl;
          RPZRecordToPolicy(rr, newZone, true, defpol, maxTTL);
        }
       }
index b5977d9d0467d0976c420844b25fb002ba1ae43f..10dc0522db1771ad405386e45d51887d6009db19 100644 (file)
@@ -109,7 +109,7 @@ void RPZRecordToPolicy(const DNSRecord& dr, std::shared_ptr<DNSFilterEngine::Zon
     else if(!crcTarget.empty() && !crcTarget.isRoot() && crcTarget.getRawLabel(crcTarget.countLabels() - 1).compare(0, rpzPrefix.length(), rpzPrefix) == 0) {
       /* this is very likely an higher format number or a configuration error,
          let's just ignore it. */
-      L<<Logger::Info<<"Discarding unsupported RPZ entry "<<crcTarget.toString()<<" for "<<dr.d_name<<endl;
+      L<<Logger::Info<<"Discarding unsupported RPZ entry "<<crcTarget<<" for "<<dr.d_name<<endl;
       return;
     }
     else {
index 5c026511af11c4ccd4803631f0e3a3c2bcac4c12..8215de663217caae36c11680ae90b5633c0c2421 100644 (file)
@@ -1252,7 +1252,7 @@ inline vector<DNSName> SyncRes::shuffleInSpeedOrder(NsSet &tnameservers, const s
           LOG(endl<<prefix<<"             ");
         }
       }
-      LOG((i->empty() ? string("<empty>") : i->toString())<<"(" << (boost::format("%0.2f") % (speeds[*i]/1000.0)).str() <<"ms)");
+      LOG(i->toLogString()<<"(" << (boost::format("%0.2f") % (speeds[*i]/1000.0)).str() <<"ms)");
     }
     LOG(endl);
   }
index 42c84018fec6e905da035729f1a5a80ec03c8f32..6f05813417a3420ada08c22a15d393db9f69c638 100644 (file)
@@ -604,7 +604,7 @@ BOOST_AUTO_TEST_CASE(test_compare_canonical) {
   }
   sort(vec.begin(), vec.end(), CanonDNSNameCompare());
   //  for(const auto& v : vec)
-  //    cerr<<'"'<<v.toString()<<'"'<<endl;
+  //    cerr<<'"'<<v<<'"'<<endl;
 
   vector<DNSName> right;
   for(const auto& b: {"bert.com.",  "Aleph1.powerdns.com.",
index cf2c7809b6da49253a01a9bcb3563b51b2af72c9..22563d0a48d183357b39b5c0d3d2d76de5215f96 100644 (file)
@@ -60,7 +60,7 @@ try
   Socket sock(AF_INET, SOCK_DGRAM);
   ComboAddress dest(argv[1] + (*argv[1]=='@'), atoi(argv[2]));
   seedRandom("/dev/urandom");
-  cerr<<"Keyname: '"<<keyname.toString()<<"', algo: '"<<trc.d_algoName.toString()<<"', key: '"<<Base64Encode(key)<<"'\n";
+  cerr<<"Keyname: '"<<keyname<<"', algo: '"<<trc.d_algoName<<"', key: '"<<Base64Encode(key)<<"'\n";
   TSIGTriplet tt;
   tt.name=keyname;
   tt.algo=DNSName("hmac-md5");
index 66b7d13eafb027e65a817b470d779acaef1646b8..e82c86da7b3941d471e11d035ef765e1f2f77ba5 100644 (file)
@@ -333,7 +333,7 @@ dState getDenial(const cspmap_t &validrrsets, const DNSName& qname, const uint16
         */
         if (nsec->d_set.count(QType::NS) && !nsec->d_set.count(QType::SOA) &&
             signer.countLabels() < owner.countLabels()) {
-          LOG("type is "<<QType(qtype).getName()<<", NS is "<<std::to_string(nsec->d_set.count(QType::NS))<<", SOA is "<<std::to_string(nsec->d_set.count(QType::SOA))<<", signer is "<<signer.toString()<<", owner name is "<<owner.toString()<<endl);
+          LOG("type is "<<QType(qtype).getName()<<", NS is "<<std::to_string(nsec->d_set.count(QType::NS))<<", SOA is "<<std::to_string(nsec->d_set.count(QType::SOA))<<", signer is "<<signer<<", owner name is "<<owner<<endl);
           /* this is an "ancestor delegation" NSEC RR */
           if (qname == owner && qtype != QType::DS) {
             LOG("An ancestor delegation NSEC RR can only deny the existence of a DS"<<endl);
@@ -445,7 +445,7 @@ dState getDenial(const cspmap_t &validrrsets, const DNSName& qname, const uint16
         */
         if (nsec3->d_set.count(QType::NS) && !nsec3->d_set.count(QType::SOA) &&
             signer.countLabels() < v.first.first.countLabels()) {
-          LOG("type is "<<QType(qtype).getName()<<", NS is "<<std::to_string(nsec3->d_set.count(QType::NS))<<", SOA is "<<std::to_string(nsec3->d_set.count(QType::SOA))<<", signer is "<<signer.toString()<<", owner name is "<<v.first.first.toString()<<endl);
+          LOG("type is "<<QType(qtype).getName()<<", NS is "<<std::to_string(nsec3->d_set.count(QType::NS))<<", SOA is "<<std::to_string(nsec3->d_set.count(QType::SOA))<<", signer is "<<signer<<", owner name is "<<v.first.first<<endl);
           /* this is an "ancestor delegation" NSEC3 RR */
           if (beginHash == h && qtype != QType::DS) {
             LOG("An ancestor delegation NSEC3 RR can only deny the existence of a DS"<<endl);
@@ -909,7 +909,7 @@ vState getKeysFor(DNSRecordOracle& dro, const DNSName& zone, skeyset_t& keyset)
         lowestNTA = negAnchor.first;
 
     if(!lowestNTA.empty()) {
-      LOG("Found a Negative Trust Anchor for "<<lowestNTA.toStringRootDot()<<", which was added with reason '"<<negAnchors.at(lowestNTA)<<"', ");
+      LOG("Found a Negative Trust Anchor for "<<lowestNTA<<", which was added with reason '"<<negAnchors.at(lowestNTA)<<"', ");
 
       /* RFC 7646 section 2.1 tells us that we SHOULD still validate if there
        * is a Trust Anchor below the Negative Trust Anchor for the name we
@@ -920,7 +920,7 @@ vState getKeysFor(DNSRecordOracle& dro, const DNSName& zone, skeyset_t& keyset)
         LOG("marking answer Insecure"<<endl);
         return NTA; // Not Insecure, this way validateRecords() can shortcut
       }
-      LOG("but a Trust Anchor for "<<lowestTA.toStringRootDot()<<" is configured, continuing validation."<<endl);
+      LOG("but a Trust Anchor for "<<lowestTA<<" is configured, continuing validation."<<endl);
     }
   }