]> granicus.if.org Git - pdns/commitdiff
further logging silencing
authorbert hubert <bert.hubert@powerdns.com>
Mon, 2 May 2016 11:46:13 +0000 (13:46 +0200)
committerbert hubert <bert.hubert@powerdns.com>
Mon, 2 May 2016 11:46:52 +0000 (13:46 +0200)
pdns/rec-lua-conf.cc
pdns/rpzloader.cc

index 90fdfd1d3832872c0d6914af49555f8f0787f929..4dd1010bb3f2affe0a17b90b1f968f7da6a2d6fa 100644 (file)
@@ -114,7 +114,9 @@ void loadRecursorLuaConfig(const std::string& fname)
            }
          }
        }
+        theL()<<Logger::Warning<<"Loading RPZ from file '"<<fname<<"'"<<endl;
        loadRPZFromFile(fname, lci.dfe, polName, defpol, 0);
+        theL()<<Logger::Warning<<"Done loading RPZ from file '"<<fname<<"'"<<endl;
       }
       catch(std::exception& e) {
        theL()<<Logger::Error<<"Unable to load RPZ zone from '"<<fname<<"': "<<e.what()<<endl;
index 4c27a8f3c5ba89eb04180d3532e60575d363ae71..90a2dace320e6bd7118ffe071425dd9df89f8a44 100644 (file)
@@ -142,6 +142,7 @@ shared_ptr<SOARecordContent> loadRPZFromServer(const ComboAddress& master, const
   return sr;
 }
 
+// this function is silent - you do the logging
 int loadRPZFromFile(const std::string& fname, DNSFilterEngine& target, const std::string& polName, boost::optional<DNSFilterEngine::Policy> defpol, int place)
 {
   ZoneParserTNG zpt(fname);
@@ -154,7 +155,6 @@ int loadRPZFromFile(const std::string& fname, DNSFilterEngine& target, const std
       DNSRecord dr(drr);
       if(dr.d_type == QType::SOA) {
        domain = dr.d_name;
-//     cerr<<"Origin is "<<domain<<endl;
       }
       else if(dr.d_type == QType::NS) {
        continue;
@@ -165,8 +165,7 @@ int loadRPZFromFile(const std::string& fname, DNSFilterEngine& target, const std
       }
     }
     catch(PDNSException& pe) {
-      cerr<<"Issue parsing '"<<drr.qname<<"' '"<<drr.content<<"' at "<<zpt.getLineOfFile()<<endl;
-      cerr<<pe.reason<<endl;
+      throw PDNSException("Issue parsing '"+drr.qname.toString()+"' '"+drr.content+"' at "+zpt.getLineOfFile()+": "+pe.reason);
     }
   }