std::lock_guard<std::mutex> l(d_mutex);
auto iter = d_statuses.find(cd);
if(iter == d_statuses.end()) {
- // L<<Logger::Warning<<"Launching HTTP(s) status checker for "<<remote.toStringWithPort()<<" and URL "<<url<<endl;
+ // g_log<<Logger::Warning<<"Launching HTTP(s) status checker for "<<remote.toStringWithPort()<<" and URL "<<url<<endl;
std::thread* checker = new std::thread(&IsUpOracle::checkURLThread, this, remote, url, opts);
d_statuses[cd]=Checker{checker, false};
return false;
}
s.connect(rem, 1);
if(!isUp(cd)) {
- L<<Logger::Warning<<"Lua record monitoring declaring TCP/IP "<<rem.toStringWithPort()<<" ";
+ g_log<<Logger::Warning<<"Lua record monitoring declaring TCP/IP "<<rem.toStringWithPort()<<" ";
if(opts.count("source"))
- L<<"(source "<<src.toString()<<") ";
- L<<"UP!"<<endl;
+ g_log<<"(source "<<src.toString()<<") ";
+ g_log<<"UP!"<<endl;
}
setUp(cd);
}
catch(NetworkError& ne) {
if(isUp(rem, opts) || first)
- L<<Logger::Warning<<"Lua record monitoring declaring TCP/IP "<<rem.toStringWithPort()<<" DOWN: "<<ne.what()<<endl;
+ g_log<<Logger::Warning<<"Lua record monitoring declaring TCP/IP "<<rem.toStringWithPort()<<" DOWN: "<<ne.what()<<endl;
setDown(cd);
}
sleep(1);
throw std::runtime_error(boost::str(boost::format("unable to match content with `%s`") % opts.at("stringmatch")));
}
if(!upStatus(rem,url,opts))
- L<<Logger::Warning<<"LUA record monitoring declaring "<<rem.toString()<<" UP for URL "<<url<<"!"<<endl;
+ g_log<<Logger::Warning<<"LUA record monitoring declaring "<<rem.toString()<<" UP for URL "<<url<<"!"<<endl;
setUp(rem, url,opts);
}
catch(std::exception& ne) {
if(upStatus(rem,url,opts) || first)
- L<<Logger::Warning<<"LUA record monitoring declaring "<<rem.toString()<<" DOWN for URL "<<url<<", error: "<<ne.what()<<endl;
+ g_log<<Logger::Warning<<"LUA record monitoring declaring "<<rem.toString()<<" DOWN for URL "<<url<<", error: "<<ne.what()<<endl;
setDown(rem,url,opts);
}
sleep(5);
extern std::function<std::string(const std::string& ip, int)> g_getGeo;
if(!g_getGeo) {
if(!initialized) {
- L<<Logger::Error<<"LUA Record attempted to use GeoIPBackend functionality, but backend not launched"<<endl;
+ g_log<<Logger::Error<<"LUA Record attempted to use GeoIPBackend functionality, but backend not launched"<<endl;
initialized=true;
}
return "unknown";
else if(selector=="hashed")
return hashed(bestwho, candidates);
- L<<Logger::Warning<<"LUA Record called with unknown selector '"<<selector<<"'"<<endl;
+ g_log<<Logger::Warning<<"LUA Record called with unknown selector '"<<selector<<"'"<<endl;
return pickrandom(candidates);
}
return fmt.str();
}
catch(std::exception& e) {
- L<<Logger::Error<<"error: "<<e.what()<<endl;
+ g_log<<Logger::Error<<"error: "<<e.what()<<endl;
}
return std::string("error");
});
return fmt.str();
}
catch(std::exception& e) {
- L<<Logger::Error<<"LUA Record xception: "<<e.what()<<endl;
+ g_log<<Logger::Error<<"LUA Record xception: "<<e.what()<<endl;
}
catch(PDNSException& e) {
- L<<Logger::Error<<"LUA Record exception: "<<e.reason<<endl;
+ g_log<<Logger::Error<<"LUA Record exception: "<<e.reason<<endl;
}
return std::string("unknown");
});
}
}
catch(std::exception& e) {
- L<<Logger::Error<<"Failed to load include record for LUArecord "<<(DNSName(record)+zone)<<": "<<e.what()<<endl;
+ g_log<<Logger::Error<<"Failed to load include record for LUArecord "<<(DNSName(record)+zone)<<": "<<e.what()<<endl;
}
});
ret.push_back(std::shared_ptr<DNSRecordContent>(DNSRecordContent::mastermake(qtype, 1, content )));
}
} catch(std::exception &e) {
- L<<Logger::Error<<"Lua record reported: "<<e.what()<<endl;
+ g_log<<Logger::Error<<"Lua record reported: "<<e.what()<<endl;
throw ;
}
while(B.get(rr)) {
if(rr.dr.d_type == QType::LUA) {
if(!doLua) {
- DLOG(L<<"Have a wildcard LUA match, but not doing LUA record for this zone"<<endl);
+ DLOG(g_log<<"Have a wildcard LUA match, but not doing LUA record for this zone"<<endl);
continue;
}
- DLOG(L<<"Have a wildcard LUA match"<<endl);
+ DLOG(g_log<<"Have a wildcard LUA match"<<endl);
auto rec=getRR<LUARecordContent>(rr.dr);
if(rec->d_type == QType::CNAME || rec->d_type == p->qtype.getCode()) {
// noCache=true;
- DLOG(L<<"Executing Lua: '"<<rec->getCode()<<"'"<<endl);
+ DLOG(g_log<<"Executing Lua: '"<<rec->getCode()<<"'"<<endl);
try {
auto recvec=luaSynth(rec->getCode(), target, sd.qname, sd.domain_id, *p, rec->d_type);
for(const auto& r : recvec) {