2010-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Enclosed log of DHTMessage::toString() with Logger::info().
	* src/DHTMessageDispatcherImpl.cc
	* src/DHTMessageReceiver.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-03-04 17:07:07 +00:00
parent ca54ff894e
commit b55f2de8e6
3 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2010-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Enclosed log of DHTMessage::toString() with Logger::info().
* src/DHTMessageDispatcherImpl.cc
* src/DHTMessageReceiver.cc
2010-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten util::toHex().

View File

@ -76,7 +76,9 @@ DHTMessageDispatcherImpl::sendMessage(const SharedHandle<DHTMessageEntry>& entry
if(!entry->_message->isReply()) {
_tracker->addMessage(entry->_message, entry->_timeout, entry->_callback);
}
if(_logger->info()) {
_logger->info("Message sent: %s", entry->_message->toString().c_str());
}
} else {
return false;
}

View File

@ -110,7 +110,9 @@ SharedHandle<DHTMessage> DHTMessageReceiver::receiveMessage()
return handleUnknownMessage(data, sizeof(data), remoteAddr, remotePort);
}
}
if(_logger->info()) {
_logger->info("Message received: %s", message->toString().c_str());
}
message->validate();
message->doReceivedAction();
message->getRemoteNode()->markGood();
@ -139,7 +141,9 @@ DHTMessageReceiver::handleUnknownMessage(const unsigned char* data,
{
SharedHandle<DHTMessage> m =
_factory->createUnknownMessage(data, length, remoteAddr, remotePort);
if(_logger->info()) {
_logger->info("Message received: %s", m->toString().c_str());
}
return m;
}