-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add debugging mode to connection settings #2538
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
Conversation
This commit adds the ability to set .EnableDebugMode() on ConnectionSettings which turns direct streaming and pretty JSON on and writes DebugInformation to the output window. It also accepts an optional Action<IApiCallDetails> to perform when the request is completed, but preserves the original OnRequestCompleted action that might be set on ConnectionSettings. Closes #2535
{ | ||
originalCompletedRequestHandler?.Invoke(d); | ||
onRequestCompleted?.Invoke(d); | ||
System.Diagnostics.Debug.WriteLine(d.DebugInformation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to let the user do this in their delegate themselves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write to the debug output, or preserve the original request handler? Or both? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write to debug output :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sort of like that we write to it automatically as part of "debug mode", but I see the argument against it. I'll remove it and update the PR 👍.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can make the default handler write the debug info, and let the user supplied one override it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that works for me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done with my last commit
* Add debugging mode to connection settings This commit adds the ability to set .EnableDebugMode() on ConnectionSettings which turns direct streaming and pretty JSON on and writes DebugInformation to the output window. It also accepts an optional Action<IApiCallDetails> to perform when the request is completed, but preserves the original OnRequestCompleted action that might be set on ConnectionSettings. Closes #2535 * move debug.write to default request completed handler
* Add debugging mode to connection settings This commit adds the ability to set .EnableDebugMode() on ConnectionSettings which turns direct streaming and pretty JSON on and writes DebugInformation to the output window. It also accepts an optional Action<IApiCallDetails> to perform when the request is completed, but preserves the original OnRequestCompleted action that might be set on ConnectionSettings. Closes #2535 * move debug.write to default request completed handler
ported to |
* Add debugging mode to connection settings This commit adds the ability to set .EnableDebugMode() on ConnectionSettings which turns direct streaming and pretty JSON on and writes DebugInformation to the output window. It also accepts an optional Action<IApiCallDetails> to perform when the request is completed, but preserves the original OnRequestCompleted action that might be set on ConnectionSettings. Closes elastic#2535 * move debug.write to default request completed handler
This commit adds the ability to set .EnableDebugMode() on
ConnectionSettings which turns direct streaming and pretty JSON on and
writes DebugInformation to the output window.
It also accepts an optional Action to perform when the
request is completed, but preserves the original OnRequestCompleted action
that might be set on ConnectionSettings.
Closes #2535