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

View File

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

View File

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

View File

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

View File

@ -315,7 +315,9 @@ void upnphandler::shutdown()
void upnphandler::restart()
{
/* non-blocking call to shutdown upnp, and startup again. */
#ifdef UPNP_DEBUG
std::cerr << "upnphandler::restart() called." << std::endl;
#endif
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
{
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog: sending group chat typing info." << std::endl ;
#endif
rsMsgs->sendGroupChatStatusString(rsiface->getConfig().ownName + " is typing...");
last_status_send_time = time(NULL) ;

View File

@ -627,20 +627,24 @@ void PopupChatDialog::changeStyle()
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;
int size = 0 ;
std::cerr << "Requesting avatar image for peer " << peer_id << std::endl ;
rsMsgs->getAvatarData(peer_id,data,size);
#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 ;
#endif
ui.avatarlabel->setPixmap(QPixmap(":/images/no_avatar_70.png"));
return ;
}
@ -660,10 +664,15 @@ void PopupChatDialog::updateAvatar()
rsMsgs->getOwnAvatarData(data,size);
#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 ;
#endif
}
// set the image
QPixmap pix ;