You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The oauth-service.ts file has manyconsole.error and console.warn calls. This is possibly great default behavior, but I'd like to be able to overwrite it for two main reasons:
Sometimes I disagree with the error. Put differently, I'm working on a case currently where the console.error is not an error but an expected exceptional situation which I will handle myself.
In production I'd prefer to keep my console clean of anything but critical stuff, and have a logging service to catch all the other stuff
For those reasons I propose we decouple the OAuthService from console functions, for example similar to how you can inject a different OAuthStorage.
then the service can rely on OAuthLoggingAdapter being injected (replacing all console.warn/.error calls), and users of the library can themselves provide a different implementation, if they like.
I'm happy to write a PR for this, but before I do so I'd love to get some feedback on whether it's a good idea and whether the PR has a chance of being accepted.
The text was updated successfully, but these errors were encountered:
The
oauth-service.ts
file has manyconsole.error
andconsole.warn
calls. This is possibly great default behavior, but I'd like to be able to overwrite it for two main reasons:console.error
is not an error but an expected exceptional situation which I will handle myself.For those reasons I propose we decouple the
OAuthService
fromconsole
functions, for example similar to how you can inject a differentOAuthStorage
.Some (pseudo)code:
and default:
then the service can rely on
OAuthLoggingAdapter
being injected (replacing allconsole.warn
/.error
calls), and users of the library can themselves provide a different implementation, if they like.I'm happy to write a PR for this, but before I do so I'd love to get some feedback on whether it's a good idea and whether the PR has a chance of being accepted.
The text was updated successfully, but these errors were encountered: