@@ -146,8 +146,7 @@ Connector<BUFFER, NetProvider>::connect(Connection<BUFFER, NetProvider> &conn,
146146 // Make sure that connection is not yet established.
147147 assert (conn.get_strm ().has_status (SS_DEAD));
148148 if (m_NetProvider.connect (conn, opts) != 0 ) {
149- LOG_ERROR (" Failed to connect to " ,
150- opts.address , ' :' , opts.service );
149+ TNT_LOG_ERROR (" Failed to connect to " , opts.address , ' :' , opts.service );
151150 return -1 ;
152151 }
153152 conn.getImpl ()->is_greeting_received = false ;
@@ -156,8 +155,7 @@ Connector<BUFFER, NetProvider>::connect(Connection<BUFFER, NetProvider> &conn,
156155 // Encode auth request to reserve space in buffer.
157156 conn.prepare_auth (opts.user , opts.passwd );
158157 }
159- LOG_DEBUG (" Connection to " , opts.address , ' :' , opts.service ,
160- " has been established" );
158+ TNT_LOG_DEBUG (" Connection to " , opts.address , ' :' , opts.service , " has been established" );
161159 return 0 ;
162160}
163161
@@ -258,7 +256,7 @@ Connector<BUFFER, NetProvider>::wait(Connection<BUFFER, NetProvider> &conn,
258256 rid_t future, int timeout,
259257 Response<BUFFER> *result)
260258{
261- LOG_DEBUG (" Waiting for the future " , future, " with timeout " , timeout);
259+ TNT_LOG_DEBUG (" Waiting for the future " , future, " with timeout " , timeout);
262260 Timer timer{timeout};
263261 timer.start ();
264262 static constexpr int INVALID_SYNC = -1 ;
@@ -269,7 +267,7 @@ Connector<BUFFER, NetProvider>::wait(Connection<BUFFER, NetProvider> &conn,
269267 return -1 ;
270268 if (result != NULL && result->header .sync != INVALID_SYNC) {
271269 assert (result->header .sync == req_sync);
272- LOG_DEBUG (" Future " , future, " is ready and decoded" );
270+ TNT_LOG_DEBUG (" Future " , future, " is ready and decoded" );
273271 return 0 ;
274272 }
275273 while (!conn.hasError () && !conn.futureIsReady (future)) {
@@ -282,24 +280,23 @@ Connector<BUFFER, NetProvider>::wait(Connection<BUFFER, NetProvider> &conn,
282280 return -1 ;
283281 if (result != NULL && result->header .sync != INVALID_SYNC) {
284282 assert (result->header .sync == req_sync);
285- LOG_DEBUG (" Future " , future, " is ready and decoded" );
283+ TNT_LOG_DEBUG (" Future " , future, " is ready and decoded" );
286284 return 0 ;
287285 }
288286 if (timer.isExpired ())
289287 break ;
290288 }
291289 if (conn.hasError ()) {
292- LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
290+ TNT_LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
293291 return -1 ;
294292 }
295293 if (! conn.futureIsReady (future)) {
296- LOG_DEBUG (" Connection has been timed out: future " , future,
297- " is not ready" );
294+ TNT_LOG_DEBUG (" Connection has been timed out: future " , future, " is not ready" );
298295 return -1 ;
299296 } else if (result != NULL ) {
300297 *result = std::move (conn.getResponse (future));
301298 }
302- LOG_DEBUG (" Feature " , future, " is ready and decoded" );
299+ TNT_LOG_DEBUG (" Feature " , future, " is ready and decoded" );
303300 return 0 ;
304301}
305302
@@ -331,10 +328,10 @@ Connector<BUFFER, NetProvider>::waitAll(Connection<BUFFER, NetProvider> &conn,
331328 break ;
332329 }
333330 if (conn.hasError ()) {
334- LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
331+ TNT_LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
335332 return -1 ;
336333 }
337- LOG_DEBUG (" Connection has been timed out: not all futures are ready" );
334+ TNT_LOG_DEBUG (" Connection has been timed out: not all futures are ready" );
338335 return -1 ;
339336}
340337
@@ -346,14 +343,14 @@ Connector<BUFFER, NetProvider>::waitAny(int timeout)
346343 timer.start ();
347344 while (m_ReadyToDecode.empty ()) {
348345 if (m_NetProvider.wait (timer.timeLeft ()) != 0 ) {
349- LOG_ERROR (" Failed to poll connections: " , strerror (errno));
346+ TNT_LOG_ERROR (" Failed to poll connections: " , strerror (errno));
350347 return std::nullopt ;
351348 }
352349 if (timer.isExpired ())
353350 break ;
354351 }
355352 if (m_ReadyToDecode.empty ()) {
356- LOG_DEBUG (" wait() has been timed out! No responses are received" );
353+ TNT_LOG_DEBUG (" wait() has been timed out! No responses are received" );
357354 return std::nullopt ;
358355 }
359356 Connection<BUFFER, NetProvider> conn = *m_ReadyToDecode.begin ();
@@ -391,11 +388,10 @@ Connector<BUFFER, NetProvider>::waitCount(Connection<BUFFER, NetProvider> &conn,
391388 break ;
392389 }
393390 if (conn.hasError ()) {
394- LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
391+ TNT_LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
395392 return -1 ;
396393 }
397- LOG_DEBUG (" Connection has been timed out: only " ,
398- conn.getFutureCount () - ready_futures, " are ready" );
394+ TNT_LOG_DEBUG (" Connection has been timed out: only " , conn.getFutureCount () - ready_futures, " are ready" );
399395 return -1 ;
400396}
401397
0 commit comments