further log cleanings

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2271 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-02-10 10:56:54 +00:00
parent be92a7941a
commit b46cf457db
7 changed files with 80 additions and 71 deletions

View File

@ -45,18 +45,14 @@ std::ostream &operator<<(std::ostream &out, const ChannelInfo &info)
std::ostream &operator<<(std::ostream &out, const ChannelMsgSummary &info) std::ostream &operator<<(std::ostream &out, const ChannelMsgSummary &info)
{ {
out << "ChannelMsgSummary:"; out << "ChannelMsgSummary: ChannelId: " << info.channelId << std::endl;
out << std::endl;
out << "ChannelId: " << info.channelId << std::endl;
return out; return out;
} }
std::ostream &operator<<(std::ostream &out, const ChannelMsgInfo &info) std::ostream &operator<<(std::ostream &out, const ChannelMsgInfo &info)
{ {
out << "ChannelMsgInfo:"; out << "ChannelMsgInfo: ChannelId: " << info.channelId << std::endl;
out << std::endl;
out << "ChannelId: " << info.channelId << std::endl;
return out; return out;
} }
@ -82,11 +78,8 @@ p3Channels::p3Channels(uint16_t type, CacheStrapper *cs,
//loadDummyData(); //loadDummyData();
/* create chanDir */ /* create chanDir */
if (!RsDirUtil::checkCreateDirectory(mChannelsDir)) if (!RsDirUtil::checkCreateDirectory(mChannelsDir)) {
{ std::cerr << "p3Channels() Failed to create Channels Directory: " << mChannelsDir << std::endl;
std::cerr << "p3Channels() Failed to create Channels Directory: ";
std::cerr << mChannelsDir;
std::cerr << std::endl;
} }
return; return;
@ -283,9 +276,9 @@ RsDistribGrp *p3Channels::locked_createPrivateDistribGrp(GroupInfo &info)
bool p3Channels::channelSubscribe(std::string cId, bool subscribe) bool p3Channels::channelSubscribe(std::string cId, bool subscribe)
{ {
std::cerr << "p3Channels::channelSubscribe() "; #ifdef CHANNEL_DEBUG
std::cerr << cId; std::cerr << "p3Channels::channelSubscribe() " << cId << std::endl;
std::cerr << std::endl; #endif
return subscribeToGroup(cId, subscribe); return subscribeToGroup(cId, subscribe);
} }
@ -367,11 +360,10 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std
* FileRequest will ignore request if file is already indexed. * FileRequest will ignore request if file is already indexed.
*/ */
std::cerr << "p3Channels::locked_eventDuplicateMsg() "; #ifdef CHANNEL_DEBUG
std::cerr << " Downloading: " << fname; std::cerr << "p3Channels::locked_eventDuplicateMsg() " << " Downloading: " << fname;
std::cerr << " to: " << localpath; std::cerr << " to: " << localpath << " from: " << id << std::endl;
std::cerr << " from: " << id; #endif
std::cerr << std::endl;
mRsFiles->FileRequest(fname, hash, size, mRsFiles->FileRequest(fname, hash, size,
localpath, flags, srcIds); localpath, flags, srcIds);
@ -423,40 +415,40 @@ void p3Channels::locked_notifyGroupChanged(GroupInfo &grp, uint32_t flags)
switch(flags) switch(flags)
{ {
case GRP_NEW_UPDATE: case GRP_NEW_UPDATE:
std::cerr << "p3Channels::locked_notifyGroupChanged() NEW UPDATE"; #ifdef CHANNEL_DEBUG
std::cerr << std::endl; std::cerr << "p3Channels::locked_notifyGroupChanged() NEW UPDATE" << std::endl;
#endif
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_CHAN_NEW, grpId, msgId, nullId); getPqiNotify()->AddFeedItem(RS_FEED_ITEM_CHAN_NEW, grpId, msgId, nullId);
break; break;
case GRP_UPDATE: case GRP_UPDATE:
std::cerr << "p3Channels::locked_notifyGroupChanged() UPDATE"; #ifdef CHANNEL_DEBUG
std::cerr << std::endl; std::cerr << "p3Channels::locked_notifyGroupChanged() UPDATE" << std::endl;
#endif
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_CHAN_UPDATE, grpId, msgId, nullId); getPqiNotify()->AddFeedItem(RS_FEED_ITEM_CHAN_UPDATE, grpId, msgId, nullId);
break; break;
case GRP_LOAD_KEY: case GRP_LOAD_KEY:
std::cerr << "p3Channels::locked_notifyGroupChanged() LOAD_KEY"; #ifdef CHANNEL_DEBUG
std::cerr << std::endl; std::cerr << "p3Channels::locked_notifyGroupChanged() LOAD_KEY" << std::endl;
#endif
break; break;
case GRP_NEW_MSG: case GRP_NEW_MSG:
std::cerr << "p3Channels::locked_notifyGroupChanged() NEW MSG"; #ifdef CHANNEL_DEBUG
std::cerr << std::endl; std::cerr << "p3Channels::locked_notifyGroupChanged() NEW MSG" << std::endl;
break; #endif
break;
case GRP_SUBSCRIBED: case GRP_SUBSCRIBED:
std::cerr << "p3Channels::locked_notifyGroupChanged() SUBSCRIBED"; #ifdef CHANNEL_DEBUG
std::cerr << std::endl; std::cerr << "p3Channels::locked_notifyGroupChanged() SUBSCRIBED" << std::endl;
#endif
{ {
std::string channeldir = mChannelsDir + "/" + grpId; std::string channeldir = mChannelsDir + "/" + grpId;
#ifdef CHANNEL_DEBUG
std::cerr << "p3Channels::locked_notifyGroupChanged() "; std::cerr << "p3Channels::locked_notifyGroupChanged() creating directory: " << channeldir << std::endl;
std::cerr << " creating directory: " << channeldir; #endif
std::cerr << std::endl;
/* create chanDir */ /* create chanDir */
if (!RsDirUtil::checkCreateDirectory(channeldir)) if (!RsDirUtil::checkCreateDirectory(channeldir)) {
{ std::cerr << "p3Channels::locked_notifyGroupChanged() Failed to create Channels Directory: " << channeldir << std::endl;
std::cerr << "p3Channels::locked_notifyGroupChanged() ";
std::cerr << "Failed to create Channels Directory: ";
std::cerr << channeldir;
std::cerr << std::endl;
} }
/* check if downloads need to be started? */ /* check if downloads need to be started? */
@ -464,16 +456,16 @@ void p3Channels::locked_notifyGroupChanged(GroupInfo &grp, uint32_t flags)
break; break;
case GRP_UNSUBSCRIBED: case GRP_UNSUBSCRIBED:
std::cerr << "p3Channels::locked_notifyGroupChanged() UNSUBSCRIBED"; #ifdef CHANNEL_DEBUG
std::cerr << std::endl; std::cerr << "p3Channels::locked_notifyGroupChanged() UNSUBSCRIBED" << std::endl;
#endif
/* won't stop downloads... */ /* won't stop downloads... */
break; break;
default: default:
std::cerr << "p3Channels::locked_notifyGroupChanged() Unknown DEFAULT"; std::cerr << "p3Channels::locked_notifyGroupChanged() Unknown DEFAULT" << std::endl;
std::cerr << std::endl;
break; break;
} }

View File

@ -318,7 +318,9 @@ std::list<RsChatMsgItem *> p3ChatService::getChatQueue()
std::map<std::string,AvatarInfo *>::const_iterator it = _avatars.find(ci->PeerId()) ; std::map<std::string,AvatarInfo *>::const_iterator it = _avatars.find(ci->PeerId()) ;
#ifdef CHAT_DEBUG
std::cerr << "p3chatservice:: avatar requested from above. " << std::endl ; std::cerr << "p3chatservice:: avatar requested from above. " << std::endl ;
#endif
// has avatar. Return it strait away. // has avatar. Return it strait away.
// //
if(it!=_avatars.end() && it->second->_peer_is_new) if(it!=_avatars.end() && it->second->_peer_is_new)
@ -530,11 +532,13 @@ void p3ChatService::getAvatarJpegData(const std::string& peer_id,unsigned char *
std::cerr << "Already has avatar. Returning it" << std::endl ; std::cerr << "Already has avatar. Returning it" << std::endl ;
#endif #endif
return ; return ;
} } else {
else #ifdef CHAT_DEBUG
std::cerr << "No avatar for this peer. Requesting it by sending request packet." << std::endl ; std::cerr << "No avatar for this peer. Requesting it by sending request packet." << std::endl ;
#endif
}
sendAvatarRequest(peer_id) ; sendAvatarRequest(peer_id);
} }
void p3ChatService::sendAvatarRequest(const std::string& peer_id) void p3ChatService::sendAvatarRequest(const std::string& peer_id)
@ -579,7 +583,9 @@ RsChatAvatarItem *p3ChatService::makeOwnAvatarItem()
void p3ChatService::sendAvatarJpegData(const std::string& peer_id) void p3ChatService::sendAvatarJpegData(const std::string& peer_id)
{ {
#ifdef CHAT_DEBUG
std::cerr << "p3chatservice: sending requested for peer " << peer_id << ", data=" << (void*)_own_avatar << std::endl ; std::cerr << "p3chatservice: sending requested for peer " << peer_id << ", data=" << (void*)_own_avatar << std::endl ;
#endif
if(_own_avatar != NULL) if(_own_avatar != NULL)
{ {
@ -593,8 +599,11 @@ void p3ChatService::sendAvatarJpegData(const std::string& peer_id)
sendItem(ci) ; sendItem(ci) ;
} }
else else {
std::cerr << "Doing nothing" << std::endl ; #ifdef CHAT_DEBUG
std::cerr << "Doing nothing" << std::endl ;
#endif
}
} }
bool p3ChatService::loadList(std::list<RsItem*> load) bool p3ChatService::loadList(std::list<RsItem*> load)

View File

@ -288,8 +288,9 @@ void UdpLayer::recv_loop()
} }
else if (status < 0) else if (status < 0)
{ {
std::cerr << "UdpLayer::recv_loop() "; #ifdef DEBUG_UDP_LAYER
std::cerr << "Error: " << tounet_errno() << std::endl; std::cerr << "UdpLayer::recv_loop() Error: " << tounet_errno() << std::endl;
#endif
} }
}; };

View File

@ -710,8 +710,7 @@ bool CUPnPService::Execute(
#endif #endif
} }
#ifdef UPNP_DEBUG #ifdef UPNP_DEBUG
std::cerr << ")"; std::cerr << ")" << std::endl;
std::cerr << std::endl;
#endif #endif
// Everything is ok, make the action // Everything is ok, make the action
IXML_Document *ActionDoc = NULL; IXML_Document *ActionDoc = NULL;
@ -739,8 +738,7 @@ bool CUPnPService::Execute(
0, NULL); 0, NULL);
if (!ActionDoc) { if (!ActionDoc) {
#ifdef UPNP_DEBUG #ifdef UPNP_DEBUG
std::cerr << "CUPnPService::Execute() Error: UpnpMakeAction returned NULL."; std::cerr << "CUPnPService::Execute() Error: UpnpMakeAction returned NULL." << std::endl;
std::cerr << std::endl;
#endif #endif
return false; return false;
} }
@ -765,8 +763,7 @@ const std::string CUPnPService::GetStateVariable(
it = propertyMap.find(stateVariableName); it = propertyMap.find(stateVariableName);
if (it != propertyMap.end()) { if (it != propertyMap.end()) {
#ifdef UPNP_DEBUG #ifdef UPNP_DEBUG
std::cerr << "CUPnPService::GetStateVariable(" << stateVariableName << ") = "; std::cerr << "CUPnPService::GetStateVariable(" << stateVariableName << ") = " << (*it).second << std::endl;
std::cerr << (*it).second << std::endl;
#endif #endif
return (*it).second; return (*it).second;
} else { } else {
@ -803,14 +800,12 @@ const std::string CUPnPService::GetStateVariable(
it = propertyMap.find(stateVariableName); it = propertyMap.find(stateVariableName);
if (it != propertyMap.end()) { if (it != propertyMap.end()) {
#ifdef UPNP_DEBUG #ifdef UPNP_DEBUG
std::cerr << "CUPnPService::GetStateVariable(" << stateVariableName << ") = "; std::cerr << "CUPnPService::GetStateVariable(" << stateVariableName << ") = " << (*it).second << std::endl;
std::cerr << (*it).second << std::endl;
#endif #endif
return (*it).second; return (*it).second;
} else { } else {
#ifdef UPNP_DEBUG #ifdef UPNP_DEBUG
std::cerr << "CUPnPService::GetStateVariable(" << stateVariableName << ") = "; std::cerr << "CUPnPService::GetStateVariable(" << stateVariableName << ") = " << "Empty String" << std::endl;
std::cerr << "Empty String" << std::endl;
#endif #endif
return stdEmptyString; return stdEmptyString;
} }
@ -1326,8 +1321,7 @@ upnpDiscovery:
int ret; int ret;
if (d_event->ErrCode != UPNP_E_SUCCESS) { if (d_event->ErrCode != UPNP_E_SUCCESS) {
#ifdef UPNP_DEBUG #ifdef UPNP_DEBUG
std::cerr << upnpCP->m_upnpLib.GetUPnPErrorMessage(d_event->ErrCode) << "."; std::cerr << upnpCP->m_upnpLib.GetUPnPErrorMessage(d_event->ErrCode) << "." << std::endl;
std::cerr << std::endl;
#endif #endif
} }
#ifdef UPNP_DEBUG #ifdef UPNP_DEBUG

View File

@ -315,7 +315,9 @@ void upnphandler::shutdown()
void upnphandler::restart() void upnphandler::restart()
{ {
/* non-blocking call to shutdown upnp, and startup again. */ /* non-blocking call to shutdown upnp, and startup again. */
#ifdef UPNP_DEBUG
std::cerr << "upnphandler::restart() called." << std::endl; std::cerr << "upnphandler::restart() called." << std::endl;
#endif
background_setup_upnp(true, true); background_setup_upnp(true, true);
} }

View File

@ -815,7 +815,9 @@ void PeersDialog::updateStatusTyping()
{ {
if(time(NULL) - last_status_send_time > 5) // limit 'peer is typing' packets to at most every 10 sec if(time(NULL) - last_status_send_time > 5) // limit 'peer is typing' packets to at most every 10 sec
{ {
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog: sending group chat typing info." << std::endl ; std::cerr << "PeersDialog: sending group chat typing info." << std::endl ;
#endif
rsMsgs->sendGroupChatStatusString(rsiface->getConfig().ownName + " is typing..."); rsMsgs->sendGroupChatStatusString(rsiface->getConfig().ownName + " is typing...");
last_status_send_time = time(NULL) ; last_status_send_time = time(NULL) ;

View File

@ -627,20 +627,24 @@ void PopupChatDialog::changeStyle()
void PopupChatDialog::updatePeerAvatar(const std::string& peer_id) void PopupChatDialog::updatePeerAvatar(const std::string& peer_id)
{ {
std::cerr << "popupchatDialog: updating avatar for peer " << peer_id << std::endl ; #ifdef CHAT_DEBUG
std::cerr << "popupchatDialog::updatePeerAvatar() updating avatar for peer " << peer_id << std::endl ;
std::cerr << "Requesting avatar image for peer " << peer_id << std::endl ;
#endif
unsigned char *data = NULL; unsigned char *data = NULL;
int size = 0 ; int size = 0 ;
std::cerr << "Requesting avatar image for peer " << peer_id << std::endl ;
rsMsgs->getAvatarData(peer_id,data,size); rsMsgs->getAvatarData(peer_id,data,size);
std::cerr << "Image size = " << size << std::endl ; #ifdef CHAT_DEBUG
std::cerr << "Image size = " << size << std::endl;
#endif
if(size == 0) if(size == 0) {
{ #ifdef CHAT_DEBUG
std::cerr << "Got no image" << std::endl ; std::cerr << "Got no image" << std::endl ;
#endif
ui.avatarlabel->setPixmap(QPixmap(":/images/no_avatar_70.png")); ui.avatarlabel->setPixmap(QPixmap(":/images/no_avatar_70.png"));
return ; return ;
} }
@ -660,10 +664,15 @@ void PopupChatDialog::updateAvatar()
rsMsgs->getOwnAvatarData(data,size); rsMsgs->getOwnAvatarData(data,size);
#ifdef CHAT_DEBUG
std::cerr << "Image size = " << size << std::endl ; std::cerr << "Image size = " << size << std::endl ;
#endif
if(size == 0) if(size == 0) {
std::cerr << "Got no image" << std::endl ; #ifdef CHAT_DEBUG
std::cerr << "Got no image" << std::endl ;
#endif
}
// set the image // set the image
QPixmap pix ; QPixmap pix ;