Skip to content

Commit 84900c2

Browse files
committed
* Log connection events
1 parent 7c2e148 commit 84900c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

projects/Test/OAuth2/TestOAuth2.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,22 @@ public async Task InitializeAsync()
165165
{
166166
_connection = await _connectionFactory.CreateConnectionAsync(_cancellationTokenSource.Token);
167167

168+
_connection.ConnectionShutdown += (sender, ea) =>
169+
{
170+
_testOutputHelper.WriteLine("{0} [WARNING] connection shutdown!", DateTime.Now);
171+
};
172+
173+
_connection.ConnectionRecoveryError += (sender, ea) =>
174+
{
175+
_testOutputHelper.WriteLine("{0} [ERROR] connection recovery error: {1}",
176+
DateTime.Now, ea.Exception);
177+
};
178+
179+
_connection.RecoverySucceeded += (sender, ea) =>
180+
{
181+
_testOutputHelper.WriteLine("{0} [INFO] connection recovery succeeded", DateTime.Now);
182+
};
183+
168184
_credentialsRefresher = new CredentialsRefresher(_credentialsProvider,
169185
OnCredentialsRefreshedAsync,
170186
_cancellationTokenSource.Token);

0 commit comments

Comments
 (0)