log shut up

This commit is contained in:
RetroPooh 2018-04-01 17:26:48 +03:00
parent 4be73b7049
commit 0a943ea9ee
5 changed files with 29 additions and 4 deletions

View File

@ -56,6 +56,7 @@ static struct RsLog::logInfo p3connectzoneInfo = {RsLog::Default, "p3connect"};
/**** /****
* #define LINKMGR_DEBUG 1 * #define LINKMGR_DEBUG 1
* #define LINKMGR_DEBUG_LOG 1
* #define LINKMGR_DEBUG_CONNFAIL 1 * #define LINKMGR_DEBUG_CONNFAIL 1
* #define LINKMGR_DEBUG_ACTIONS 1 * #define LINKMGR_DEBUG_ACTIONS 1
* #define LINKMGR_DEBUG_LINKTYPE 1 * #define LINKMGR_DEBUG_LINKTYPE 1
@ -620,7 +621,9 @@ bool p3LinkMgrIMPL::connectAttempt(const RsPeerId &id, struct sockaddr_storage &
} }
#ifdef LINKMGR_DEBUG_LOG
rslog(RSL_WARNING, p3connectzone, "p3LinkMgrIMPL::connectAttempt() called id: " + id.toStdString()); rslog(RSL_WARNING, p3connectzone, "p3LinkMgrIMPL::connectAttempt() called id: " + id.toStdString());
#endif
it->second.lastattempt = time(NULL); it->second.lastattempt = time(NULL);
it->second.inConnAttempt = true; it->second.inConnAttempt = true;
@ -823,7 +826,9 @@ bool p3LinkMgrIMPL::connectResult(const RsPeerId &id, bool success, bool isIncom
out += " FAILED ATTEMPT (Not Connected)"; out += " FAILED ATTEMPT (Not Connected)";
} }
} }
#ifdef LINKMGR_DEBUG_LOG
rslog(RSL_WARNING, p3connectzone, out); rslog(RSL_WARNING, p3connectzone, out);
#endif
} }
@ -2057,8 +2062,9 @@ bool p3LinkMgrIMPL::locked_ConnectAttempt_Complete(peerConnectState *peer)
int p3LinkMgrIMPL::addFriend(const RsPeerId &id, bool isVisible) int p3LinkMgrIMPL::addFriend(const RsPeerId &id, bool isVisible)
{ {
#ifdef LINKMGR_DEBUG_LOG
rslog(RSL_WARNING, p3connectzone, "p3LinkMgr::addFriend() id: " + id.toStdString()); rslog(RSL_WARNING, p3connectzone, "p3LinkMgr::addFriend() id: " + id.toStdString());
#endif
{ {
RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/ RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/

View File

@ -69,6 +69,7 @@ static struct RsLog::logInfo p3peermgrzoneInfo = {RsLog::Default, "p3peermgr"};
/**** /****
* #define PEER_DEBUG 1 * #define PEER_DEBUG 1
* #define PEER_DEBUG_LOG 1
***/ ***/
#define MAX_AVAIL_PERIOD 230 //times a peer stay in available state when not connected #define MAX_AVAIL_PERIOD 230 //times a peer stay in available state when not connected
@ -910,8 +911,9 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg
RsPeerId id = input_id ; RsPeerId id = input_id ;
RsPgpId gpg_id = input_gpg_id ; RsPgpId gpg_id = input_gpg_id ;
#ifdef PEER_DEBUG_LOG
rslog(RSL_WARNING, p3peermgrzone, "p3PeerMgr::addFriend() id: " + id.toStdString()); rslog(RSL_WARNING, p3peermgrzone, "p3PeerMgr::addFriend() id: " + id.toStdString());
#endif
{ {
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/

View File

@ -45,6 +45,7 @@ static std::list<RsPeerId> waitingIds;
/**** /****
*#define PGRP_DEBUG 1 *#define PGRP_DEBUG 1
*#define PGRP_DEBUG_LOG 1
****/ ****/
#define DEFAULT_DOWNLOAD_KB_RATE (200.0) #define DEFAULT_DOWNLOAD_KB_RATE (200.0)
@ -420,7 +421,9 @@ int pqipersongrp::addPeer(const RsPeerId& id)
sm -> pqi = pqip; sm -> pqi = pqip;
// reset it to start it working. // reset it to start it working.
#ifdef PGRP_DEBUG_LOG
pqioutput(PQL_WARNING, pqipersongrpzone, "pqipersongrp::addPeer() => reset() called to initialise new person"); pqioutput(PQL_WARNING, pqipersongrpzone, "pqipersongrp::addPeer() => reset() called to initialise new person");
#endif
pqip -> reset(); pqip -> reset();
pqip -> listen(); pqip -> listen();

View File

@ -61,6 +61,7 @@ static struct RsLog::logInfo pqisslzoneInfo = {RsLog::Default, "pqisslzone"};
#define PQISSL_DEBUG 1 #define PQISSL_DEBUG 1
#define PQISSL_LOG_DEBUG 1 #define PQISSL_LOG_DEBUG 1
#define PQISSL_LOG_DEBUG2 1
const int PQISSL_LOCAL_FLAG = 0x01; const int PQISSL_LOCAL_FLAG = 0x01;
const int PQISSL_REMOTE_FLAG = 0x02; const int PQISSL_REMOTE_FLAG = 0x02;
@ -269,7 +270,9 @@ int pqissl::reset_locked()
#endif #endif
} }
#ifdef PQISSL_LOG_DEBUG2
rslog(RSL_ALERT, pqisslzone, outLog); rslog(RSL_ALERT, pqisslzone, outLog);
#endif
// notify people of problem! // notify people of problem!
// but only if we really shut something down. // but only if we really shut something down.
@ -678,7 +681,9 @@ int pqissl::Initiate_Connection()
std::string out; std::string out;
rs_sprintf(out, "pqissl::Initiate_Connection() Connecting To: %s via: ", PeerId().toStdString().c_str()); rs_sprintf(out, "pqissl::Initiate_Connection() Connecting To: %s via: ", PeerId().toStdString().c_str());
out += sockaddr_storage_tostring(addr); out += sockaddr_storage_tostring(addr);
#ifdef PQISSL_LOG_DEBUG2
rslog(RSL_WARNING, pqisslzone, out); rslog(RSL_WARNING, pqisslzone, out);
#endif
} }
if (sockaddr_storage_isnull(addr)) if (sockaddr_storage_isnull(addr))
@ -832,10 +837,14 @@ bool pqissl::CheckConnectionTimeout()
std::string out; std::string out;
rs_sprintf(out, "pqissl::Basic_Connection_Complete() Connection Timed Out. Peer: %s Period: %lu", PeerId().toStdString().c_str(), mConnectTimeout); rs_sprintf(out, "pqissl::Basic_Connection_Complete() Connection Timed Out. Peer: %s Period: %lu", PeerId().toStdString().c_str(), mConnectTimeout);
#ifdef PQISSL_LOG_DEBUG2
rslog(RSL_WARNING, pqisslzone, out); rslog(RSL_WARNING, pqisslzone, out);
#endif
/* as sockfd is valid, this should close it all up */ /* as sockfd is valid, this should close it all up */
#ifdef PQISSL_LOG_DEBUG2
rslog(RSL_ALERT, pqisslzone, "pqissl::Basic_Connection_Complete() -> calling reset()"); rslog(RSL_ALERT, pqisslzone, "pqissl::Basic_Connection_Complete() -> calling reset()");
#endif
reset_locked(); reset_locked();
return true; return true;
} }
@ -974,7 +983,9 @@ int pqissl::Basic_Connection_Complete()
{ {
std::string out; std::string out;
rs_sprintf(out, "pqissl::Basic_Connection_Complete() TCP Connection Complete: cert: %s on osock: ", PeerId().toStdString().c_str(), sockfd); rs_sprintf(out, "pqissl::Basic_Connection_Complete() TCP Connection Complete: cert: %s on osock: ", PeerId().toStdString().c_str(), sockfd);
#ifdef PQISSL_LOG_DEBUG2
rslog(RSL_WARNING, pqisslzone, out); rslog(RSL_WARNING, pqisslzone, out);
#endif
} }
return 1; return 1;
} }

View File

@ -42,6 +42,7 @@ static struct RsLog::logInfo pqisslproxyzoneInfo = {RsLog::Default, "pqisslproxy
#define pqisslproxyzone &pqisslproxyzoneInfo #define pqisslproxyzone &pqisslproxyzoneInfo
// #define PROXY_DEBUG 1 // #define PROXY_DEBUG 1
// #define PROXY_DEBUG_LOG 1
#define PROXY_STATE_FAILED 0 #define PROXY_STATE_FAILED 0
#define PROXY_STATE_INIT 1 #define PROXY_STATE_INIT 1
@ -593,8 +594,9 @@ bool pqisslproxy::connect_parameter(uint32_t type, const std::string &value)
{ {
std::string out; std::string out;
rs_sprintf(out, "pqisslproxy::connect_parameter() Peer: %s DOMAIN_ADDRESS: %s", PeerId().toStdString().c_str(), value.c_str()); rs_sprintf(out, "pqisslproxy::connect_parameter() Peer: %s DOMAIN_ADDRESS: %s", PeerId().toStdString().c_str(), value.c_str());
#ifdef PROXY_DEBUG_LOG
rslog(RSL_WARNING, pqisslproxyzone, out); rslog(RSL_WARNING, pqisslproxyzone, out);
#endif
mDomainAddress = value; mDomainAddress = value;
#ifdef PROXY_DEBUG #ifdef PROXY_DEBUG
std::cerr << out << std::endl; std::cerr << out << std::endl;
@ -615,8 +617,9 @@ bool pqisslproxy::connect_parameter(uint32_t type, uint32_t value)
{ {
std::string out; std::string out;
rs_sprintf(out, "pqisslproxy::connect_parameter() Peer: %s REMOTE_PORT: %lu", PeerId().toStdString().c_str(), value); rs_sprintf(out, "pqisslproxy::connect_parameter() Peer: %s REMOTE_PORT: %lu", PeerId().toStdString().c_str(), value);
#ifdef PROXY_DEBUG_LOG
rslog(RSL_WARNING, pqisslproxyzone, out); rslog(RSL_WARNING, pqisslproxyzone, out);
#endif
mRemotePort = value; mRemotePort = value;
#ifdef PROXY_DEBUG #ifdef PROXY_DEBUG
std::cerr << out << std::endl; std::cerr << out << std::endl;