Browse Source

[1067] Added little bit of logging

Michal 'vorner' Vaner 13 years ago
parent
commit
6df7102965
2 changed files with 17 additions and 0 deletions
  1. 6 0
      src/lib/datasrc/database.cc
  2. 11 0
      src/lib/datasrc/datasrc_messages.mes

+ 6 - 0
src/lib/datasrc/database.cc

@@ -342,6 +342,8 @@ public:
         if (!data_ready_) {
             // At the end of zone
             ready_ = false;
+            LOG_DEBUG(logger, DBG_TRACE_DETAILED,
+                      DATASRC_DATABASE_ITERATE_END);
             return (ConstRRsetPtr());
         }
         string name_str(name_), rtype_str(rtype_), ttl(ttl_);
@@ -356,6 +358,8 @@ public:
             rrset->addRdata(rdata::createRdata(rtype, class_, rdata_));
             getData();
         }
+        LOG_DEBUG(logger, DBG_TRACE_DETAILED, DATASRC_DATABASE_ITERATE_NEXT).
+            arg(rrset->getName()).arg(rrset->getType());
         return (rrset);
     }
 private:
@@ -404,6 +408,8 @@ DatabaseClient::getIterator(const isc::dns::Name& name) const {
     // actual zone class from the connection, as the DatabaseClient
     // doesn't know it and the iterator needs it (so it wouldn't query
     // it each time)
+    LOG_DEBUG(logger, DBG_TRACE_DETAILED, DATASRC_DATABASE_ITERATE).
+        arg(name);
     return (ZoneIteratorPtr(new DatabaseIterator(context, RRClass::IN())));
 }
 

+ 11 - 0
src/lib/datasrc/datasrc_messages.mes

@@ -103,6 +103,17 @@ 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.
 
+% DATASRC_DATABASE_ITERATE iterating zone %1
+The program is reading the whole zone, eg. not searching for data, but going
+through each of the RRsets there.
+
+% DATASRC_DATABASE_ITERATE_END iterating zone finished
+While iterating through the zone, the program reached end of the data.
+
+% DATASRC_DATABASE_ITERATE_NEXT next RRset in zone is %1/%2
+While iterating through the zone, the program extracted next RRset from it.
+The name and RRtype of the RRset is indicated in the message.
+
 % DATASRC_DO_QUERY handling query for '%1/%2'
 A debug message indicating that a query for the given name and RR type is being
 processed.