-
-
Notifications
You must be signed in to change notification settings - Fork 979
Enable diagnostics in release #1263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
d2fb3ac
fe29a0d
261d34f
2ce4d61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| using System; | ||
| using System.Diagnostics; | ||
| using System.Globalization; | ||
| using System.Net.Sockets; | ||
| using System.Threading; | ||
|
|
||
| using Renci.SshNet.Abstractions; | ||
| using Renci.SshNet.Common; | ||
| using Renci.SshNet.Messages; | ||
| using Renci.SshNet.Messages.Connection; | ||
|
|
@@ -554,9 +554,9 @@ protected virtual void Close() | |
| // SSH_MSG_CHANNEL_CLOSE as response to a SSH_MSG_CHANNEL_CLOSE sent by the | ||
| // server | ||
| var closeWaitResult = _session.TryWait(_channelClosedWaitHandle, ConnectionInfo.ChannelCloseTimeout); | ||
| if (closeWaitResult != WaitResult.Success) | ||
| if (closeWaitResult != WaitResult.Success && Diagnostics.IsEnabled(TraceEventType.Warning)) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get why we need the condition what if someone forgot to check it?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need it, it just prevents doing any extra work like allocating string instances unnecessarily in the case that the log level is not enabled. But TBH I don't think it would make a material impact either way. |
||
| { | ||
| DiagnosticAbstraction.Log(string.Format("Wait for channel close not successful: {0:G}.", closeWaitResult)); | ||
| Diagnostics.Log($"Wait for channel close not successful: {closeWaitResult}.", TraceEventType.Warning); | ||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.