@@ -373,7 +373,7 @@ def connect(self):
373
373
self .state = ConnectionStates .AUTHENTICATING
374
374
else :
375
375
# security_protocol PLAINTEXT
376
- log .debug ('%s: Connection complete.' , self )
376
+ log .info ('%s: Connection complete.' , self )
377
377
self .state = ConnectionStates .CONNECTED
378
378
self ._reset_reconnect_backoff ()
379
379
self .config ['state_change_callback' ](self )
@@ -383,7 +383,8 @@ def connect(self):
383
383
elif ret not in (errno .EINPROGRESS , errno .EALREADY , errno .EWOULDBLOCK , 10022 ):
384
384
log .error ('Connect attempt to %s returned error %s.'
385
385
' Disconnecting.' , self , ret )
386
- self .close (Errors .ConnectionError (ret ))
386
+ errstr = errno .errorcode .get (ret , 'UNKNOWN' )
387
+ self .close (Errors .ConnectionError ('{} {}' .format (ret , errstr )))
387
388
388
389
# Connection timed out
389
390
elif time .time () > request_timeout + self .last_attempt :
@@ -401,7 +402,7 @@ def connect(self):
401
402
log .debug ('%s: initiating SASL authentication' , self )
402
403
self .state = ConnectionStates .AUTHENTICATING
403
404
else :
404
- log .debug ('%s: Connection complete.' , self )
405
+ log .info ('%s: Connection complete.' , self )
405
406
self .state = ConnectionStates .CONNECTED
406
407
self .config ['state_change_callback' ](self )
407
408
@@ -410,7 +411,7 @@ def connect(self):
410
411
if self ._try_authenticate ():
411
412
# _try_authenticate has side-effects: possibly disconnected on socket errors
412
413
if self .state is ConnectionStates .AUTHENTICATING :
413
- log .debug ('%s: Connection complete.' , self )
414
+ log .info ('%s: Connection complete.' , self )
414
415
self .state = ConnectionStates .CONNECTED
415
416
self ._reset_reconnect_backoff ()
416
417
self .config ['state_change_callback' ](self )
0 commit comments