From: Michal 'vorner' Vaner Date: Tue, 29 May 2012 11:59:38 +0000 (+0200) Subject: [1944] Don't use shared method for logging X-Git-Tag: trac2351_base~226^2~64^2^2~2^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b128daebb970c0b09680e1d1c485af8dcfc4ab55;p=thirdparty%2Fkea.git [1944] Don't use shared method for logging At least for some logging. This eliminates having more real parameters than placeholders for the used messages. Other occurrences of the function are preserved, as the corresponding messages have full set of placeholders. --- diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc index 7b271f1327..62fa61ef5a 100644 --- a/src/lib/datasrc/database.cc +++ b/src/lib/datasrc/database.cc @@ -839,8 +839,6 @@ DatabaseClient::Finder::findOnNameResult(const Name& name, flags)); } else if (wti != found.second.end()) { bool any(type == RRType::ANY()); - isc::log::MessageID lid(wild ? DATASRC_DATABASE_WILDCARD_MATCH : - DATASRC_DATABASE_FOUND_RRSET); if (any) { // An ANY query, copy everything to the target instead of returning // directly. @@ -851,15 +849,32 @@ DatabaseClient::Finder::findOnNameResult(const Name& name, target->push_back(it->second); } } - lid = wild ? DATASRC_DATABASE_WILDCARD_ANY : - DATASRC_DATABASE_FOUND_ANY; + if (wild) { + LOG_DEBUG(logger, DBG_TRACE_DETAILED, + DATASRC_DATABASE_WILDCARD_ANY). + arg(accessor_->getDBName()).arg(name); + } else { + LOG_DEBUG(logger, DBG_TRACE_DETAILED, + DATASRC_DATABASE_FOUND_ANY). + arg(accessor_->getDBName()).arg(name); + } + } else { + if (wild) { + LOG_DEBUG(logger, DBG_TRACE_DETAILED, + DATASRC_DATABASE_WILDCARD_MATCH). + arg(accessor_->getDBName()).arg(*wildname). + arg(wti->second); + } else { + LOG_DEBUG(logger, DBG_TRACE_DETAILED, + DATASRC_DATABASE_FOUND_RRSET). + arg(accessor_->getDBName()).arg(wti->second); + } } // Found an RR matching the query, so return it. (Note that this // includes the case where we were explicitly querying for a CNAME and // found it. It also includes the case where we were querying for an // NS RRset and found it at the apex of the zone.) - return (logAndCreateResult(name, wildname, type, SUCCESS, - wti->second, lid, flags)); + return (ResultContext(SUCCESS, wti->second, flags)); } // If we get here, we have found something at the requested name but not diff --git a/src/lib/datasrc/datasrc_messages.mes b/src/lib/datasrc/datasrc_messages.mes index 9cfb3ef02a..7e3d5c2bdd 100644 --- a/src/lib/datasrc/datasrc_messages.mes +++ b/src/lib/datasrc/datasrc_messages.mes @@ -160,7 +160,7 @@ A search in the database for RRs for the specified name, type and class has located RRs that match the name and class but not the type. DNSSEC information has been requested and returned. -% DATASRC_DATABASE_FOUND_RRSET search in datasource %1 resulted in RRset %5 +% DATASRC_DATABASE_FOUND_RRSET search in datasource %1 resulted in RRset %2 The data returned by the database backend contained data for the given domain name, and it either matches the type or has a relevant type. The RRset that is returned is printed. @@ -279,7 +279,7 @@ nonterminal (e.g. there's nothing at *.example.com but something like subdomain.*.example.org, do exist: so *.example.org exists in the namespace but has no RRs assopciated with it). This will produce NXRRSET. -% DATASRC_DATABASE_WILDCARD_MATCH search in datasource %1 resulted in wildcard match at %5 with RRset %6 +% DATASRC_DATABASE_WILDCARD_MATCH search in datasource %1 resulted in wildcard match at %2 with RRset %3 The database doesn't contain directly matching name. When searching for a wildcard match, a wildcard record matching the name and type of the query was found. The data at this point is returned.