Closed dylanberry closed 5 years ago
Love it!!
What about the idea of having a Default = 0
position on the enumerator. Default would then be handled two ways.
If the user does nothing, it'll be "Information" (or maybe Warning...)
The user can also set the default via a static method/property.
HttpTracerHandler.DefaultLogLevel = LogLevel.Error
This way they can have a global log level for all instances, as well as custom log levels per instance where necessary.
@ChaseFlorell I like both those suggestions. Thanks for the thoughts and feedback!
What about offering the ability to take all HttpStatusCodes or a filtered list?
As a secondary part, add the ability to say parts of the Http body parts I want?
[Flags]
public enum HttpBodyParts
{
RequestBody = 1,
RequestHeaders = 2,
RequestAll = RequestBody | RequestHeaders,
ResponseBody = 4,
ResponseHeaders = 8,
ResponseAll = ResponseBody | ResponseHeaders,
All = ResponseAll | RequestAll
}
This is definitely a better approach. I'll revise the spec.
I have a PR open for discussion purposes. #37
Summary
Writing all request and response data can be a heavy operation. We need a mechanism to control verbosity on the fly.
API
HttpMessageParts Flags
HttpTracerHandler Public Property
HttpTracerHandler Public Static Property
NOTE: we must validate this is not set to
HttpMessageParts.Unknown
Usage
The developer will need to ensure the
HttpTracerHandler
instance is available in order to change the verbosity on the fly.