@@ -86,7 +86,7 @@ EpollNetProvider<BUFFER, Stream>::EpollNetProvider(Connector_t &connector) :
8686{
8787 m_EpollFd = epoll_create1 (EPOLL_CLOEXEC);
8888 if (m_EpollFd == -1 ) {
89- LOG_ERROR (" Failed to initialize epoll: " , strerror (errno));
89+ TNT_LOG_ERROR (" Failed to initialize epoll: " , strerror (errno));
9090 abort ();
9191 }
9292}
@@ -109,9 +109,7 @@ EpollNetProvider<BUFFER, Stream>::registerEpoll(Conn_t &conn)
109109 event.data .ptr = conn.getImpl ();
110110 if (epoll_ctl (m_EpollFd, EPOLL_CTL_ADD, conn.get_strm ().get_fd (),
111111 &event) != 0 ) {
112- LOG_ERROR (" Failed to add socket to epoll: "
113- " epoll_ctl() returned with errno: " ,
114- strerror (errno));
112+ TNT_LOG_ERROR (" Failed to add socket to epoll: epoll_ctl() returned with errno: " , strerror (errno));
115113 abort ();
116114 }
117115}
@@ -124,9 +122,7 @@ EpollNetProvider<BUFFER, Stream>::setPollSetting(Conn_t &conn, int setting) {
124122 event.data .ptr = conn.getImpl ();
125123 if (epoll_ctl (m_EpollFd, EPOLL_CTL_MOD, conn.get_strm ().get_fd (),
126124 &event) != 0 ) {
127- LOG_ERROR (" Failed to change epoll mode: "
128- " epoll_ctl() returned with errno: " ,
129- strerror (errno));
125+ TNT_LOG_ERROR (" Failed to change epoll mode: epoll_ctl() returned with errno: " , strerror (errno));
130126 abort ();
131127 }
132128}
@@ -142,7 +138,7 @@ EpollNetProvider<BUFFER, Stream>::connect(Conn_t &conn,
142138 opts.address );
143139 return -1 ;
144140 }
145- LOG_DEBUG (" Connected to " , opts.address , " , socket is " , strm.get_fd ());
141+ TNT_LOG_DEBUG (" Connected to " , opts.address , " , socket is " , strm.get_fd ());
146142
147143 registerEpoll (conn);
148144 return 0 ;
@@ -168,8 +164,7 @@ EpollNetProvider<BUFFER, Stream>::close(Stream_t& strm)
168164 struct sockaddr_un *sa_un = (struct sockaddr_un *) &sa;
169165 snprintf (addr, 120 , " %s" , sa_un->sun_path );
170166 }
171- LOG_DEBUG (" Closed connection to socket " , was_fd,
172- " corresponding to address " , addr);
167+ TNT_LOG_DEBUG (" Closed connection to socket " , was_fd, " corresponding to address " , addr);
173168 }
174169#endif
175170 /*
@@ -209,12 +204,12 @@ EpollNetProvider<BUFFER, Stream>::recv(Conn_t &conn)
209204 if ((size_t ) rcvd < Iproto::GREETING_SIZE)
210205 return 0 ;
211206 /* Receive and decode greetings. */
212- LOG_DEBUG (" Greetings are received, read bytes " , rcvd);
207+ TNT_LOG_DEBUG (" Greetings are received, read bytes " , rcvd);
213208 if (decodeGreeting (conn) != 0 ) {
214209 conn.setError (" Failed to decode greetings" );
215210 return -1 ;
216211 }
217- LOG_DEBUG (" Greetings are decoded" );
212+ TNT_LOG_DEBUG (" Greetings are decoded" );
218213 rcvd -= Iproto::GREETING_SIZE;
219214 if (conn.getImpl ()->is_auth_required ) {
220215 // Finalize auth request in buffer.
@@ -261,7 +256,7 @@ EpollNetProvider<BUFFER, Stream>::wait(int timeout)
261256 assert (timeout >= -1 );
262257 if (timeout == -1 )
263258 timeout = TIMEOUT_INFINITY;
264- LOG_DEBUG (" Network engine wait for " , timeout, " milliseconds" );
259+ TNT_LOG_DEBUG (" Network engine wait for " , timeout, " milliseconds" );
265260 /* Send pending requests. */
266261 for (auto conn = m_Connector.m_ReadyToSend .begin ();
267262 conn != m_Connector.m_ReadyToSend .end ();) {
@@ -276,15 +271,14 @@ EpollNetProvider<BUFFER, Stream>::wait(int timeout)
276271 if (event_cnt < 0 ) {
277272 // Poll error doesn't belong to any connection so just global
278273 // log it.
279- LOG_ERROR (" Poll failed: " , strerror (errno));
274+ TNT_LOG_ERROR (" Poll failed: " , strerror (errno));
280275 return -1 ;
281276 }
282277 for (int i = 0 ; i < event_cnt; ++i) {
283278 Conn_t conn ((typename Conn_t::Impl_t *)events[i].data .ptr );
284279 if ((events[i].events & EPOLLIN) != 0 ) {
285- LOG_DEBUG (" Registered poll event " , i, " : " ,
286- conn.get_strm ().get_fd (),
287- " socket is ready to read" );
280+ TNT_LOG_DEBUG (" Registered poll event " , i, " : " , conn.get_strm ().get_fd (),
281+ " socket is ready to read" );
288282 if (conn.get_strm ().has_status (SS_NEED_READ_EVENT_FOR_WRITE)) {
289283 int rc = send (conn);
290284 if (rc < 0 )
@@ -302,9 +296,8 @@ EpollNetProvider<BUFFER, Stream>::wait(int timeout)
302296 }
303297
304298 if ((events[i].events & EPOLLOUT) != 0 ) {
305- LOG_DEBUG (" Registered poll event " , i, " : " ,
306- conn.get_strm ().get_fd (),
307- " socket is ready to write" );
299+ TNT_LOG_DEBUG (" Registered poll event " , i, " : " , conn.get_strm ().get_fd (),
300+ " socket is ready to write" );
308301 if (conn.get_strm ().has_status (SS_NEED_WRITE_EVENT_FOR_READ)) {
309302 int rc = recv (conn);
310303 if (rc < 0 )
0 commit comments