Skip to content

Commit

Permalink
adjust debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
lichuan committed Oct 30, 2018
1 parent b5a1989 commit 4df1f52
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/fly/net/acceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ bool Acceptor<T>::start()

if(client_fd < 0)
{
LOG_FATAL("accept4 return < 0: %d %s", errno, strerror(errno));
LOG_DEBUG_FATAL("accept4 return < 0: %d %s", errno, strerror(errno));

if(errno == EMFILE)
{
Expand Down
10 changes: 5 additions & 5 deletions src/fly/net/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ bool Client<T>::connect(int32 timeout)
int32 ret = getaddrinfo(m_addr.m_host.c_str(), base::to_string(m_addr.m_port).c_str(), &hint, &result);
if(ret != 0)
{
LOG_FATAL("resolve dns failed in client::connect: %s", gai_strerror(ret));
LOG_DEBUG_FATAL("resolve dns failed in client::connect: %s", gai_strerror(ret));

return false;
}
Expand All @@ -110,13 +110,13 @@ bool Client<T>::connect(int32 timeout)
{
char ip[INET_ADDRSTRLEN];
inet_ntop(AF_INET, &((sockaddr_in*)(iter->ai_addr))->sin_addr, ip, INET_ADDRSTRLEN);
LOG_INFO("resolve ip success in client::connect host: %s, ip: %s", m_addr.m_host.c_str(), ip);
LOG_DEBUG_INFO("resolve ip success in client::connect host: %s, ip: %s", m_addr.m_host.c_str(), ip);

if(::connect(fd, iter->ai_addr, sizeof(sockaddr)) < 0)
{
if(errno != EINPROGRESS)
{
LOG_FATAL("connect failed in Client::connect, host: %s, ip: %s, port: %d %s", m_addr.m_host.c_str(), ip, m_addr.m_port, strerror(errno));
LOG_DEBUG_FATAL("connect failed in Client::connect, host: %s, ip: %s, port: %d %s", m_addr.m_host.c_str(), ip, m_addr.m_port, strerror(errno));
close(fd);

continue;
Expand All @@ -137,7 +137,7 @@ bool Client<T>::connect(int32 timeout)

if(ret == 0)
{
LOG_ERROR("connect failed, poll timeout");
LOG_DEBUG_ERROR("connect failed, poll timeout");
close(fd);

continue;
Expand All @@ -155,7 +155,7 @@ bool Client<T>::connect(int32 timeout)

if(ret != 0)
{
LOG_ERROR("connect failed, getsockopt error: %s", strerror(ret));
LOG_DEBUG_ERROR("connect failed, getsockopt error: %s", strerror(ret));
close(fd);

continue;
Expand Down
2 changes: 1 addition & 1 deletion src/fly/net/poller_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void Poller_Task<T>::run_in_loop()

if(fd_num < 0)
{
LOG_FATAL("epoll_wait failed in Poller_Task::run_in_loop %s", strerror(errno));
LOG_DEBUG_ERROR("epoll_wait failed in Poller_Task::run_in_loop %s", strerror(errno));

return;
}
Expand Down

0 comments on commit 4df1f52

Please sign in to comment.