-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add debug capabilities #19
Conversation
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.
Nice! I didn't test it out, but code lgtm.
|
||
private setContentTypeHeader(request: Request) { | ||
const [key, value] = ['Content-Type', 'application/json']; | ||
|
||
request.headers.set(key, value); | ||
|
||
debug('%o header set to %o for %o', key, value, RequestHelper.format(request)); | ||
} |
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.
Do we need this? Could we instead have a setHeader(key, value)?
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.
Where would the log originate from? RequestHelper.setHeader(req, name, value)
or from the http client when it calls it?
Let's continue the discussion and possibly add this in a later PR
What does it do?
debug
package (54kB) and supports-color (10kB)Also
Why is it needed?
Better traceability and maintainability of the codebase.
Easier issue management/reproduction with finegrained logs
How to test it?
TODO