-
Notifications
You must be signed in to change notification settings - Fork 192
Log HTTP Request and Response when Debug Switch is specified. #232
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
… for logging purposes when Debug is specified. On Module init, hook EventHandler into EventListener delegate.
Changes to AutoRest.Powershell have been reviewed and merged. |
// Set of header fields that should not get serialized | ||
private static readonly HashSet<string> _neverSerializedHeaderFields = new HashSet<string>(StringComparer.OrdinalIgnoreCase) | ||
{ | ||
"SdkVersion", |
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.
Why are we not Serializing SdkVersion and FeatureFlag? Or Cache-Control, or Date?
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.
This is legacy from the contrib project. Would it be preferable to serialize all headers, including Authorization?
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.
We should serialize headers that are useful in tracing an issue/bug. For instance, we need SdkVersion to know which version of the SDK the customer was running, featureFlag to know which middleware handlers they have enabled e.t.c. Authorization
header is not useful, and we shouldn't serialize it.
Move print method to EventExtentions.
use nameof in exceptions. add appropriate license headers.
Generated a sample module using the latest autorest.powershell that includes our code generator changes, generates correctly and |
Hook into Signal infrastructure to capture HTTP Request and Responses for logging purposes when Debug is specified.
On Module init, hook EventHandler delegate into EventListener delegate.
Use HttpFormatter from contrib repo. Does not show the Authorization header (Access Token).
Depends on changes in autorest.powershell generator
Covers task AB#4720