Browse Source

[trac744] More arguments to the debug outputs

Michal 'vorner' Vaner 14 years ago
parent
commit
8d9debda3a
2 changed files with 21 additions and 18 deletions
  1. 12 9
      src/lib/datasrc/memory_datasrc.cc
  2. 9 9
      src/lib/datasrc/messagedef.mes

+ 12 - 9
src/lib/datasrc/memory_datasrc.cc

@@ -454,7 +454,8 @@ struct MemoryZone::MemoryZoneImpl {
                 // the zone but is empty.  Treat it as NXRRSET.
                 // the zone but is empty.  Treat it as NXRRSET.
                 if (node_path.getLastComparisonResult().getRelation() ==
                 if (node_path.getLastComparisonResult().getRelation() ==
                     NameComparisonResult::SUPERDOMAIN) {
                     NameComparisonResult::SUPERDOMAIN) {
-                    logger.debug(DBG_TRACE_DATA, DATASRC_MEM_SUPER_STOP);
+                    LOG_DEBUG(logger, DBG_TRACE_DATA, DATASRC_MEM_SUPER_STOP).
+                        arg(node_path.getAbsoluteName()).arg(name);
                     return (FindResult(NXRRSET, ConstRRsetPtr()));
                     return (FindResult(NXRRSET, ConstRRsetPtr()));
                 }
                 }
 
 
@@ -493,7 +494,7 @@ struct MemoryZone::MemoryZoneImpl {
                         NameComparisonResult::COMMONANCESTOR && node_path.
                         NameComparisonResult::COMMONANCESTOR && node_path.
                         getLastComparisonResult().getCommonLabels() > 1) {
                         getLastComparisonResult().getCommonLabels() > 1) {
                         logger.debug(DBG_TRACE_DATA,
                         logger.debug(DBG_TRACE_DATA,
-                                     DATASRC_MEM_WILDCARD_CANCEL);
+                                     DATASRC_MEM_WILDCARD_CANCEL).arg(name);
                         return (FindResult(NXDOMAIN, ConstRRsetPtr()));
                         return (FindResult(NXDOMAIN, ConstRRsetPtr()));
                     }
                     }
                     Name wildcard(Name("*").concatenate(
                     Name wildcard(Name("*").concatenate(
@@ -516,7 +517,7 @@ struct MemoryZone::MemoryZoneImpl {
 
 
                 // fall through
                 // fall through
             case DomainTree::NOTFOUND:
             case DomainTree::NOTFOUND:
-                logger.debug(DBG_TRACE_DATA, DATASRC_MEM_NOTFOUND);
+                logger.debug(DBG_TRACE_DATA, DATASRC_MEM_NOTFOUND).arg(name);
                 return (FindResult(NXDOMAIN, ConstRRsetPtr()));
                 return (FindResult(NXDOMAIN, ConstRRsetPtr()));
             case DomainTree::EXACTMATCH: // This one is OK, handle it
             case DomainTree::EXACTMATCH: // This one is OK, handle it
                 break;
                 break;
@@ -528,7 +529,7 @@ struct MemoryZone::MemoryZoneImpl {
         // If there is an exact match but the node is empty, it's equivalent
         // If there is an exact match but the node is empty, it's equivalent
         // to NXRRSET.
         // to NXRRSET.
         if (node->isEmpty()) {
         if (node->isEmpty()) {
-            logger.debug(DBG_TRACE_DATA, DATASRC_MEM_DOMAIN_EMPTY);
+            logger.debug(DBG_TRACE_DATA, DATASRC_MEM_DOMAIN_EMPTY).arg(name);
             return (FindResult(NXRRSET, ConstRRsetPtr()));
             return (FindResult(NXRRSET, ConstRRsetPtr()));
         }
         }
 
 
@@ -539,7 +540,8 @@ struct MemoryZone::MemoryZoneImpl {
         if (node->getFlag(DomainNode::FLAG_CALLBACK) && node != origin_data_) {
         if (node->getFlag(DomainNode::FLAG_CALLBACK) && node != origin_data_) {
             found = node->getData()->find(RRType::NS());
             found = node->getData()->find(RRType::NS());
             if (found != node->getData()->end()) {
             if (found != node->getData()->end()) {
-                logger.debug(DBG_TRACE_DATA, DATASRC_MEM_EXACT_DELEGATION);
+                logger.debug(DBG_TRACE_DATA, DATASRC_MEM_EXACT_DELEGATION).
+                    arg(name);
                 return (FindResult(DELEGATION, prepareRRset(name,
                 return (FindResult(DELEGATION, prepareRRset(name,
                     found->second, rename)));
                     found->second, rename)));
             }
             }
@@ -555,27 +557,28 @@ struct MemoryZone::MemoryZoneImpl {
                     boost::const_pointer_cast<RRset>(prepareRRset(name,
                     boost::const_pointer_cast<RRset>(prepareRRset(name,
                     found->second, rename)));
                     found->second, rename)));
             }
             }
-            logger.debug(DBG_TRACE_DATA, DATASRC_MEM_ANY_SUCCESS);
+            logger.debug(DBG_TRACE_DATA, DATASRC_MEM_ANY_SUCCESS).arg(name);
             return (FindResult(SUCCESS, ConstRRsetPtr()));
             return (FindResult(SUCCESS, ConstRRsetPtr()));
         }
         }
 
 
         found = node->getData()->find(type);
         found = node->getData()->find(type);
         if (found != node->getData()->end()) {
         if (found != node->getData()->end()) {
             // Good, it is here
             // Good, it is here
-            logger.debug(DBG_TRACE_DATA, DATASRC_MEM_SUCCESS);
+            logger.debug(DBG_TRACE_DATA, DATASRC_MEM_SUCCESS).arg(name).
+                arg(type);
             return (FindResult(SUCCESS, prepareRRset(name, found->second,
             return (FindResult(SUCCESS, prepareRRset(name, found->second,
                 rename)));
                 rename)));
         } else {
         } else {
             // Next, try CNAME.
             // Next, try CNAME.
             found = node->getData()->find(RRType::CNAME());
             found = node->getData()->find(RRType::CNAME());
             if (found != node->getData()->end()) {
             if (found != node->getData()->end()) {
-                logger.debug(DBG_TRACE_DATA, DATASRC_MEM_CNAME);
+                logger.debug(DBG_TRACE_DATA, DATASRC_MEM_CNAME).arg(name);
                 return (FindResult(CNAME, prepareRRset(name, found->second,
                 return (FindResult(CNAME, prepareRRset(name, found->second,
                     rename)));
                     rename)));
             }
             }
         }
         }
         // No exact match or CNAME.  Return NXRRSET.
         // No exact match or CNAME.  Return NXRRSET.
-        logger.debug(DBG_TRACE_DATA, DATASRC_MEM_NXRRSET);
+        logger.debug(DBG_TRACE_DATA, DATASRC_MEM_NXRRSET).arg(type).arg(name);
         return (FindResult(NXRRSET, ConstRRsetPtr()));
         return (FindResult(NXRRSET, ConstRRsetPtr()));
     }
     }
 };
 };

+ 9 - 9
src/lib/datasrc/messagedef.mes

@@ -343,40 +343,40 @@ Debug information. A DNAME was found instead of the requested information.
 % MEM_DELEG_FOUND delegation found at '%1'
 % MEM_DELEG_FOUND delegation found at '%1'
 Debug information. A delegation point was found above the requested record.
 Debug information. A delegation point was found above the requested record.
 
 
-% MEM_SUPER_STOP stopped at superdomain, domain is empty
+% MEM_SUPER_STOP stopped at superdomain '%1', domain '%2' is empty
 Debug information. The search stopped at a superdomain of the requested
 Debug information. The search stopped at a superdomain of the requested
 domain. The domain is a empty nonterminal, therefore it is treated  as NXRRSET
 domain. The domain is a empty nonterminal, therefore it is treated  as NXRRSET
 case (eg. the domain exists, but it doesn't have the requested record type).
 case (eg. the domain exists, but it doesn't have the requested record type).
 
 
-% MEM_WILDCARD_CANCEL wildcard match canceled
+% MEM_WILDCARD_CANCEL wildcard match canceled for '%1'
 Debug information. A domain above wildcard was reached, but there's something
 Debug information. A domain above wildcard was reached, but there's something
 below the requested domain. Therefore the wildcard doesn't apply here.  This
 below the requested domain. Therefore the wildcard doesn't apply here.  This
 behaviour is specified by RFC 1034, section 4.3.3
 behaviour is specified by RFC 1034, section 4.3.3
 
 
-% MEM_NOTFOUND requested domain not found
+% MEM_NOTFOUND requested domain '%1' not found
 Debug information. The requested domain does not exist.
 Debug information. The requested domain does not exist.
 
 
-% MEM_DOMAIN_EMPTY requested domain is empty
+% MEM_DOMAIN_EMPTY requested domain '%1' is empty
 Debug information. The requested domain exists in the tree of domains, but
 Debug information. The requested domain exists in the tree of domains, but
 it is empty. Therefore it doesn't contain the requested resource type.
 it is empty. Therefore it doesn't contain the requested resource type.
 
 
-% MEM_EXACT_DELEGATION delegation at the exact domain
+% MEM_EXACT_DELEGATION delegation at the exact domain '%1'
 Debug information. There's a NS record at the requested domain. This means
 Debug information. There's a NS record at the requested domain. This means
 this zone is not authoritative for the requested domain, but a delegation
 this zone is not authoritative for the requested domain, but a delegation
 should be followed. The requested domain is an apex of some zone.
 should be followed. The requested domain is an apex of some zone.
 
 
-% MEM_ANY_SUCCESS ANY query successful
+% MEM_ANY_SUCCESS ANY query for '%1' successful
 Debug information. The domain was found and an ANY type query is being answered
 Debug information. The domain was found and an ANY type query is being answered
 by providing everything found inside the domain.
 by providing everything found inside the domain.
 
 
-% MEM_SUCCESS query successful
+% MEM_SUCCESS query for '%1/%2' successful
 Debug information. The requested record was found.
 Debug information. The requested record was found.
 
 
-% MEM_CNAME cNAME at the domain
+% MEM_CNAME CNAME at the domain '%1'
 Debug information. The requested domain is an alias to a different domain,
 Debug information. The requested domain is an alias to a different domain,
 returning the CNAME instead.
 returning the CNAME instead.
 
 
-% MEM_NXRRSET no such type
+% MEM_NXRRSET no such type '%1' at '%2'
 Debug information. The domain exists, but it doesn't hold any record of the
 Debug information. The domain exists, but it doesn't hold any record of the
 requested type.
 requested type.