-
Notifications
You must be signed in to change notification settings - Fork 689
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
Debug mode with custom Logger breaks #709
Comments
I could turn the injector into a factory. But that's not really a good option for a nice UX DI experience as it is not following the contract API |
Hmm, I originally wrote the Currently, the default is already provided through a factory, and you should be able to use a same approach with your own custom logger, non? I suppose that could be changed so that the typings are more friendly to classes like your own with a Does this provide you with enough info to fix something in your app, or do you still propose a specific change to the lib? |
Hi, thanks for the reply.
Unfortunately, the factory pattern isn't the solution nor the problem.
The logger interface is perfect.
It is with the `apply` method that is change the `this` context.
I have lost my private objects to `this` now being `console`.
I don't think we need to use `console` as the `this` as the default factory already wraps that up.
Proposed solution(s):
```js
this.logger.debug(...args)
//or
this.logger.debug.apply(this.logger, args)
//or
this.logger.debug(args[0], args.slice(1))
```
|
Makes sense to me. If someone cares to create a PR to update this that would be nice. (Fair warning though: PRs typically wait quite a bit of time before getting merged, usually only when a new Angular major version lands.) |
Will work in version 9. lands soon. |
Describe the bug
When having config
showDebugInformation
set astrue
and using a custom logger implementingOAuthLogger
.It throws an error where
To Reproduce
Steps to reproduce the behavior:
OAuthLogger
base on its contract.Expected behavior
Should see the logs go through my custom
thirdParty
object.Additional context
The problem i see is that it
applies
this to console, which i do not want.I would expect it to just use the
debug
method and let the abstraction implement what it should do with the input.The text was updated successfully, but these errors were encountered: