Skip to content

Commit 6578d27

Browse files
authored
Use LOG_TRACE instead of LOG_DEBUG (#226)
1 parent 442ad90 commit 6578d27

File tree

5 files changed

+27
-29
lines changed

5 files changed

+27
-29
lines changed

trantor/net/EventLoopThread.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ void EventLoopThread::loopFuncs()
6363
auto f = promiseForRun_.get_future();
6464
(void)f.get();
6565
loop->loop();
66-
// LOG_DEBUG << "loop out";
6766
{
6867
std::unique_lock<std::mutex> lk(loopMutex_);
6968
loop_ = nullptr;

trantor/net/TcpClient.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void TcpClient::newConnection(int sockfd)
177177
// Else the TcpClient instance has already been destroyed
178178
else
179179
{
180-
LOG_DEBUG << "TcpClient::removeConnection was skipped because "
180+
LOG_TRACE << "TcpClient::removeConnection was skipped because "
181181
"TcpClient instanced already freed";
182182
c->getLoop()->queueInLoop(
183183
std::bind(&TcpConnectionImpl::connectDestroyed,

trantor/net/inner/AresResolver.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ void AresResolver::resolveInLoop(const std::string& hostname,
131131
struct timeval tv;
132132
struct timeval* tvp = ares_timeout(ctx_, NULL, &tv);
133133
double timeout = getSeconds(tvp);
134-
// LOG_DEBUG << "timeout " << timeout << " active " << timerActive_;
135134
if (!timerActive_ && timeout >= 0.0)
136135
{
137136
loop_->runAfter(timeout,

trantor/net/inner/Connector.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void Connector::startInLoop()
6060
}
6161
else
6262
{
63-
LOG_DEBUG << "do not connect";
63+
LOG_TRACE << "do not connect";
6464
}
6565
}
6666
void Connector::connect()
@@ -272,6 +272,6 @@ void Connector::retry(int sockfd)
272272
}
273273
else
274274
{
275-
LOG_DEBUG << "do not connect";
275+
LOG_TRACE << "do not connect";
276276
}
277277
}

trantor/net/inner/TcpConnectionImpl.cc

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ std::shared_ptr<SSLContext> newSSLClientContext(
398398
{
399399
auto checkCA =
400400
SSL_CTX_load_verify_locations(ctx->get(), caPath.c_str(), NULL);
401-
LOG_DEBUG << "CA CHECK LOC: " << checkCA;
401+
LOG_TRACE << "CA CHECK LOC: " << checkCA;
402402
if (checkCA)
403403
{
404404
STACK_OF(X509_NAME) *cert_names =
@@ -485,7 +485,7 @@ void TcpConnectionImpl::startClientEncryptionInLoop(
485485
sslEncryptionPtr_->sslCtxPtr_->mtlsEnabled);
486486
if (validateCert || sslEncryptionPtr_->sslPtr_->mtlsEnabled)
487487
{
488-
LOG_DEBUG << "MTLS: " << sslEncryptionPtr_->sslPtr_->mtlsEnabled;
488+
LOG_TRACE << "MTLS: " << sslEncryptionPtr_->sslPtr_->mtlsEnabled;
489489
SSL_set_verify(sslEncryptionPtr_->sslPtr_->get(),
490490
sslEncryptionPtr_->sslPtr_->mtlsEnabled
491491
? SSL_VERIFY_PEER
@@ -532,7 +532,7 @@ void TcpConnectionImpl::startServerEncryptionInLoop(
532532
if (sslEncryptionPtr_->isServer_ == false ||
533533
sslEncryptionPtr_->sslPtr_->mtlsEnabled)
534534
{
535-
LOG_DEBUG << "MTLS: " << sslEncryptionPtr_->sslPtr_->mtlsEnabled;
535+
LOG_TRACE << "MTLS: " << sslEncryptionPtr_->sslPtr_->mtlsEnabled;
536536
SSL_set_verify(sslEncryptionPtr_->sslPtr_->get(),
537537
sslEncryptionPtr_->sslPtr_->mtlsEnabled
538538
? SSL_VERIFY_PEER
@@ -652,25 +652,25 @@ void TcpConnectionImpl::readCallback()
652652
if (errno == EPIPE || errno == ECONNRESET)
653653
{
654654
#ifdef _WIN32
655-
LOG_DEBUG << "WSAENOTCONN or WSAECONNRESET, errno=" << errno
655+
LOG_TRACE << "WSAENOTCONN or WSAECONNRESET, errno=" << errno
656656
<< " fd=" << socketPtr_->fd();
657657
#else
658-
LOG_DEBUG << "EPIPE or ECONNRESET, errno=" << errno
658+
LOG_TRACE << "EPIPE or ECONNRESET, errno=" << errno
659659
<< " fd=" << socketPtr_->fd();
660660
#endif
661661
return;
662662
}
663663
#ifdef _WIN32
664664
if (errno == WSAECONNABORTED)
665665
{
666-
LOG_DEBUG << "WSAECONNABORTED, errno=" << errno;
666+
LOG_TRACE << "WSAECONNABORTED, errno=" << errno;
667667
handleClose();
668668
return;
669669
}
670670
#else
671671
if (errno == EAGAIN) // TODO: any others?
672672
{
673-
LOG_DEBUG << "EAGAIN, errno=" << errno
673+
LOG_TRACE << "EAGAIN, errno=" << errno
674674
<< " fd=" << socketPtr_->fd();
675675
return;
676676
}
@@ -821,11 +821,11 @@ void TcpConnectionImpl::writeCallback()
821821
if (errno == EPIPE || errno == ECONNRESET)
822822
{
823823
#ifdef _WIN32
824-
LOG_DEBUG
824+
LOG_TRACE
825825
<< "WSAENOTCONN or WSAECONNRESET, errno="
826826
<< errno;
827827
#else
828-
LOG_DEBUG << "EPIPE or ECONNRESET, errno=" << errno;
828+
LOG_TRACE << "EPIPE or ECONNRESET, errno=" << errno;
829829
#endif
830830
return;
831831
}
@@ -880,11 +880,11 @@ void TcpConnectionImpl::writeCallback()
880880
if (errno == EPIPE || errno == ECONNRESET)
881881
{
882882
#ifdef _WIN32
883-
LOG_DEBUG << "WSAENOTCONN or "
883+
LOG_TRACE << "WSAENOTCONN or "
884884
"WSAECONNRESET, errno="
885885
<< errno;
886886
#else
887-
LOG_DEBUG << "EPIPE or "
887+
LOG_TRACE << "EPIPE or "
888888
"ECONNRESET, erron="
889889
<< errno;
890890
#endif
@@ -996,7 +996,7 @@ void TcpConnectionImpl::handleError()
996996
#endif
997997
err == ECONNRESET)
998998
{
999-
LOG_DEBUG << "[" << name_ << "] - SO_ERROR = " << err << " "
999+
LOG_TRACE << "[" << name_ << "] - SO_ERROR = " << err << " "
10001000
<< strerror_tl(err);
10011001
}
10021002
else
@@ -1079,10 +1079,10 @@ void TcpConnectionImpl::sendInLoop(const char *buffer, size_t length)
10791079
if (errno == EPIPE || errno == ECONNRESET) // TODO: any others?
10801080
{
10811081
#ifdef _WIN32
1082-
LOG_DEBUG << "WSAENOTCONN or WSAECONNRESET, errno="
1082+
LOG_TRACE << "WSAENOTCONN or WSAECONNRESET, errno="
10831083
<< errno;
10841084
#else
1085-
LOG_DEBUG << "EPIPE or ECONNRESET, errno=" << errno;
1085+
LOG_TRACE << "EPIPE or ECONNRESET, errno=" << errno;
10861086
#endif
10871087
return;
10881088
}
@@ -1698,13 +1698,13 @@ void TcpConnectionImpl::sendFileInLoop(const BufferNodePtr &filePtr)
16981698
if (errno == EPIPE || errno == ECONNRESET)
16991699
{
17001700
#ifdef _WIN32
1701-
LOG_DEBUG << "WSAENOTCONN or WSAECONNRESET, errno="
1701+
LOG_TRACE << "WSAENOTCONN or WSAECONNRESET, errno="
17021702
<< errno;
17031703
#else
1704-
LOG_DEBUG << "EPIPE or ECONNRESET, errno=" << errno;
1704+
LOG_TRACE << "EPIPE or ECONNRESET, errno=" << errno;
17051705
#endif
17061706
// abort
1707-
LOG_DEBUG
1707+
LOG_TRACE
17081708
<< "send stream in loop: return on connection closed";
17091709
filePtr->fileBytesToSend_ = 0;
17101710
return;
@@ -1788,12 +1788,12 @@ void TcpConnectionImpl::sendFileInLoop(const BufferNodePtr &filePtr)
17881788
if (errno == EPIPE || errno == ECONNRESET)
17891789
{
17901790
#ifdef _WIN32
1791-
LOG_DEBUG << "WSAENOTCONN or WSAECONNRESET, errno="
1791+
LOG_TRACE << "WSAENOTCONN or WSAECONNRESET, errno="
17921792
<< errno;
17931793
#else
1794-
LOG_DEBUG << "EPIPE or ECONNRESET, errno=" << errno;
1794+
LOG_TRACE << "EPIPE or ECONNRESET, errno=" << errno;
17951795
#endif
1796-
LOG_DEBUG
1796+
LOG_TRACE
17971797
<< "send file in loop: return on connection closed";
17981798
return;
17991799
}
@@ -1937,7 +1937,7 @@ TcpConnectionImpl::TcpConnectionImpl(EventLoop *loop,
19371937
validateCert_ = validateCert;
19381938
if (isServer == false || sslEncryptionPtr_->sslPtr_->mtlsEnabled)
19391939
{
1940-
LOG_DEBUG << "MTLS: " << sslEncryptionPtr_->sslPtr_->mtlsEnabled;
1940+
LOG_TRACE << "MTLS: " << sslEncryptionPtr_->sslPtr_->mtlsEnabled;
19411941
SSL_set_verify(sslEncryptionPtr_->sslPtr_->get(),
19421942
sslEncryptionPtr_->sslPtr_->mtlsEnabled
19431943
? SSL_VERIFY_PEER
@@ -1975,14 +1975,14 @@ bool TcpConnectionImpl::validatePeerCertificate()
19751975
result != X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN &&
19761976
result != X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY)
19771977
{
1978-
LOG_DEBUG << "cert error code: " << result;
1978+
LOG_TRACE << "cert error code: " << result;
19791979
LOG_ERROR << "Server certificate is not valid";
19801980
return false;
19811981
}
19821982
#else
19831983
if (result != X509_V_OK && result)
19841984
{
1985-
LOG_DEBUG << "cert error code: " << result;
1985+
LOG_TRACE << "cert error code: " << result;
19861986
LOG_ERROR << "Server certificate is not valid";
19871987
return false;
19881988
}
@@ -2000,7 +2000,7 @@ bool TcpConnectionImpl::validatePeerCertificate()
20002000
internal::verifyAltName(cert, sslEncryptionPtr_->hostname_);
20012001
X509_free(cert);
20022002

2003-
LOG_DEBUG << "domainIsValid: " << domainIsValid;
2003+
LOG_TRACE << "domainIsValid: " << domainIsValid;
20042004

20052005
// if mtlsEnabled, ignore domain validation
20062006
if (sslEncryptionPtr_->sslPtr_->mtlsEnabled || domainIsValid)

0 commit comments

Comments
 (0)