@@ -146,8 +146,7 @@ Connector<BUFFER, NetProvider>::connect(Connection<BUFFER, NetProvider> &conn,
146
146
// Make sure that connection is not yet established.
147
147
assert (conn.get_strm ().has_status (SS_DEAD));
148
148
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 );
151
150
return -1 ;
152
151
}
153
152
conn.getImpl ()->is_greeting_received = false ;
@@ -156,8 +155,7 @@ Connector<BUFFER, NetProvider>::connect(Connection<BUFFER, NetProvider> &conn,
156
155
// Encode auth request to reserve space in buffer.
157
156
conn.prepare_auth (opts.user , opts.passwd );
158
157
}
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" );
161
159
return 0 ;
162
160
}
163
161
@@ -258,7 +256,7 @@ Connector<BUFFER, NetProvider>::wait(Connection<BUFFER, NetProvider> &conn,
258
256
rid_t future, int timeout,
259
257
Response<BUFFER> *result)
260
258
{
261
- LOG_DEBUG (" Waiting for the future " , future, " with timeout " , timeout);
259
+ TNT_LOG_DEBUG (" Waiting for the future " , future, " with timeout " , timeout);
262
260
Timer timer{timeout};
263
261
timer.start ();
264
262
static constexpr int INVALID_SYNC = -1 ;
@@ -269,7 +267,7 @@ Connector<BUFFER, NetProvider>::wait(Connection<BUFFER, NetProvider> &conn,
269
267
return -1 ;
270
268
if (result != NULL && result->header .sync != INVALID_SYNC) {
271
269
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" );
273
271
return 0 ;
274
272
}
275
273
while (!conn.hasError () && !conn.futureIsReady (future)) {
@@ -282,24 +280,23 @@ Connector<BUFFER, NetProvider>::wait(Connection<BUFFER, NetProvider> &conn,
282
280
return -1 ;
283
281
if (result != NULL && result->header .sync != INVALID_SYNC) {
284
282
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" );
286
284
return 0 ;
287
285
}
288
286
if (timer.isExpired ())
289
287
break ;
290
288
}
291
289
if (conn.hasError ()) {
292
- LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
290
+ TNT_LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
293
291
return -1 ;
294
292
}
295
293
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" );
298
295
return -1 ;
299
296
} else if (result != NULL ) {
300
297
*result = std::move (conn.getResponse (future));
301
298
}
302
- LOG_DEBUG (" Feature " , future, " is ready and decoded" );
299
+ TNT_LOG_DEBUG (" Feature " , future, " is ready and decoded" );
303
300
return 0 ;
304
301
}
305
302
@@ -331,10 +328,10 @@ Connector<BUFFER, NetProvider>::waitAll(Connection<BUFFER, NetProvider> &conn,
331
328
break ;
332
329
}
333
330
if (conn.hasError ()) {
334
- LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
331
+ TNT_LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
335
332
return -1 ;
336
333
}
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" );
338
335
return -1 ;
339
336
}
340
337
@@ -346,14 +343,14 @@ Connector<BUFFER, NetProvider>::waitAny(int timeout)
346
343
timer.start ();
347
344
while (m_ReadyToDecode.empty ()) {
348
345
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));
350
347
return std::nullopt ;
351
348
}
352
349
if (timer.isExpired ())
353
350
break ;
354
351
}
355
352
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" );
357
354
return std::nullopt ;
358
355
}
359
356
Connection<BUFFER, NetProvider> conn = *m_ReadyToDecode.begin ();
@@ -391,11 +388,10 @@ Connector<BUFFER, NetProvider>::waitCount(Connection<BUFFER, NetProvider> &conn,
391
388
break ;
392
389
}
393
390
if (conn.hasError ()) {
394
- LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
391
+ TNT_LOG_ERROR (" Connection got an error: " , conn.getError ().msg );
395
392
return -1 ;
396
393
}
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" );
399
395
return -1 ;
400
396
}
401
397
0 commit comments