-
Notifications
You must be signed in to change notification settings - Fork 309
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
authStrategy does not inherit logger from Octokit #218
Comments
@gr2m can I claim this issue? Where would be the right place to add a test for this, |
you can add the test to https://github.com/octokit/core.js/blob/master/test/issues.test.ts, that's exactly what we created this file for :) |
Ah I just made the PR before I saw your comment. I'll move the test there and push a new commit |
no need, it's good as is 👍🏼 |
🎉 This issue has been resolved in version 3.1.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What happened?
@octokit/auth-app
introduced a newlog
option, similar to Octokit's logging via octokit/auth-app.js#190. But when I pass a custom logger asoptions.log
to Octokit, it is not passed down to the configured authentication strategy.Example:
If GitHub responds with a
401
(usually due to a replication lag),@octokit/auth-app
is logging a warning:But it logs using the default
console.warn
.Test case that reproduces the problem:
https://runkit.com/gr2m/octokit-core-authstrategy-custom-logger/1.0.0
What did you expect to happen?
I expected that
myCustomLogger
from theOctokit
constructor options is passed down tocreateAppAuth({ log })
, so thatmyCustomLogger.log.warn
is used to log the warning instead ofconsole.warn
.What the problem might be
We do pass the internal
request
method asoptions.request
tocreateAppAuth(options)
by default, seecore.js/src/index.ts
Lines 141 to 148 in 4582982
We have to do the same with the internal
log
objectHow to contribute
Comment below if you would like to work on this issue. Then follow the instructions in our contributing guidelines
The text was updated successfully, but these errors were encountered: