@@ -216,15 +216,15 @@ [new Symbol("connection_name")] = _connectionSettings.ConnectionName,
216216 open . MaxFrameSize = _connectionSettings . MaxFrameSize ;
217217 }
218218
219- void onOpened ( Amqp . IConnection connection , Open open1 )
219+ void OnOpened ( Amqp . IConnection connection , Open open1 )
220220 {
221- Trace . WriteLine ( TraceLevel . Verbose , $ "Connection opened. Info: { ToString ( ) } ") ;
221+ Trace . WriteLine ( TraceLevel . Verbose , $ "{ ToString ( ) } is open ") ;
222222 OnNewStatus ( State . Open , null ) ;
223223 }
224224
225225 var cf = new ConnectionFactory ( ) ;
226226
227- if ( _connectionSettings . UseSsl && _connectionSettings . TlsSettings is not null )
227+ if ( _connectionSettings is { UseSsl : true , TlsSettings : not null } )
228228 {
229229 cf . SSL . Protocols = _connectionSettings . TlsSettings . Protocols ;
230230 cf . SSL . CheckCertificateRevocation = _connectionSettings . TlsSettings . CheckCertificateRevocation ;
@@ -254,19 +254,19 @@ void onOpened(Amqp.IConnection connection, Open open1)
254254
255255 try
256256 {
257- _nativeConnection = await cf . CreateAsync ( ( _connectionSettings as ConnectionSettings ) ? . Address , open : open , onOpened : onOpened )
257+ _nativeConnection = await cf . CreateAsync ( ( _connectionSettings as ConnectionSettings ) ? . Address , open : open , onOpened : OnOpened )
258258 . ConfigureAwait ( false ) ;
259259 }
260260 catch ( Exception ex )
261261 {
262262 throw new ConnectionException (
263- $ "Connection failed. Info: { ToString ( ) } ", ex ) ;
263+ $ "{ ToString ( ) } connection failed. ", ex ) ;
264264 }
265265
266266 if ( _nativeConnection . IsClosed )
267267 {
268268 throw new ConnectionException (
269- $ "Connection failed. Info: { ToString ( ) } , error: { _nativeConnection . Error } ") ;
269+ $ "{ ToString ( ) } connection failed. , error: { _nativeConnection . Error } ") ;
270270 }
271271
272272 await _management . OpenAsync ( )
@@ -276,8 +276,8 @@ await _management.OpenAsync()
276276 }
277277 catch ( AmqpException e )
278278 {
279- Trace . WriteLine ( TraceLevel . Error , $ "Error trying to connect. Info: { ToString ( ) } , error: { e } ") ;
280- throw new ConnectionException ( $ "Error trying to connect. Info: { ToString ( ) } , error: { e } ") ;
279+ Trace . WriteLine ( TraceLevel . Error , $ "{ ToString ( ) } - Error trying to connect, error: { e } ") ;
280+ throw new ConnectionException ( $ "{ ToString ( ) } - Error trying to connect., error: { e } ") ;
281281 }
282282 finally
283283 {
@@ -310,8 +310,8 @@ await _semaphoreClose.WaitAsync()
310310 if ( error != null )
311311 {
312312 // we assume here that the connection is closed unexpectedly, since the error is not null
313- Trace . WriteLine ( TraceLevel . Warning , $ "connection is closed unexpectedly. " +
314- $ "Info: { ToString ( ) } " ) ;
313+ Trace . WriteLine ( TraceLevel . Warning , $ "{ ToString ( ) } is closed unexpectedly. "
314+ ) ;
315315
316316 // we have to check if the recovery is active.
317317 // The user may want to disable the recovery mechanism
@@ -349,9 +349,8 @@ await Task.Run(async () =>
349349 int nextDelayMs = _connectionSettings . Recovery . GetBackOffDelayPolicy ( ) . Delay ( ) ;
350350
351351 Trace . WriteLine ( TraceLevel . Information ,
352- $ "Trying Recovering connection in { nextDelayMs } milliseconds, " +
353- $ "attempt: { _connectionSettings . Recovery . GetBackOffDelayPolicy ( ) . CurrentAttempt } . " +
354- $ "Info: { ToString ( ) } )") ;
352+ $ "{ ToString ( ) } is trying Recovering connection in { nextDelayMs } milliseconds, " +
353+ $ "attempt: { _connectionSettings . Recovery . GetBackOffDelayPolicy ( ) . CurrentAttempt } . ") ;
355354
356355 await Task . Delay ( TimeSpan . FromMilliseconds ( nextDelayMs ) )
357356 . ConfigureAwait ( false ) ;
@@ -364,18 +363,18 @@ await OpenConnectionAsync()
364363 catch ( Exception e )
365364 {
366365 Trace . WriteLine ( TraceLevel . Warning ,
367- $ "Error trying to recover connection { e } . Info: { this } ") ;
366+ $ "{ ToString ( ) } Error trying to recover connection { e } ") ;
368367 }
369368 }
370369
371370 _connectionSettings . Recovery . GetBackOffDelayPolicy ( ) . Reset ( ) ;
372371 string connectionDescription = connected ? "recovered" : "not recovered" ;
373372 Trace . WriteLine ( TraceLevel . Information ,
374- $ "Connection { connectionDescription } . Info: { ToString ( ) } ") ;
373+ $ "{ ToString ( ) } is { connectionDescription } ") ;
375374
376375 if ( ! connected )
377376 {
378- Trace . WriteLine ( TraceLevel . Verbose , $ "connection is closed. Info: { ToString ( ) } ") ;
377+ Trace . WriteLine ( TraceLevel . Verbose , $ "{ ToString ( ) } connection is closed ") ;
379378 OnNewStatus ( State . Closed ,
380379 new Error ( ConnectionNotRecoveredCode ,
381380 $ "{ ConnectionNotRecoveredMessage } , recover status: { _connectionSettings . Recovery } ") ) ;
@@ -388,7 +387,7 @@ await OpenConnectionAsync()
388387
389388 if ( _connectionSettings . Recovery . IsTopologyActive ( ) )
390389 {
391- Trace . WriteLine ( TraceLevel . Information , $ "Recovering topology. Info: { ToString ( ) } ") ;
390+ Trace . WriteLine ( TraceLevel . Information , $ "{ ToString ( ) } Recovering topology ") ;
392391 var visitor = new Visitor ( _management ) ;
393392 await _recordingTopologyListener . Accept ( visitor )
394393 . ConfigureAwait ( false ) ;
@@ -403,15 +402,15 @@ await _recordingTopologyListener.Accept(visitor)
403402 }
404403 catch ( Exception e )
405404 {
406- Trace . WriteLine ( TraceLevel . Error , $ "Error trying to reconnect entities { e } . Info: { this } ") ;
405+ Trace . WriteLine ( TraceLevel . Error , $ "{ ToString ( ) } error trying to reconnect entities { e } ") ;
407406 }
408407 } ) . ConfigureAwait ( false ) ;
409408
410409 return ;
411410 }
412411
413412
414- Trace . WriteLine ( TraceLevel . Verbose , $ "connection is closed. Info: { ToString ( ) } ") ;
413+ Trace . WriteLine ( TraceLevel . Verbose , $ "{ ToString ( ) } is closed ") ;
415414 OnNewStatus ( State . Closed , Utils . ConvertError ( error ) ) ;
416415 }
417416 finally
0 commit comments