-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support for customizable logger for incoming/outgoing messages #93
Conversation
src/BasePostMessageStream.ts
Outdated
} | ||
|
||
private _log(data: StreamData, out: boolean) { | ||
this._logger.logger( |
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.
Similar comment as MetaMask/extension-port-stream#46 (comment).
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.
that's fair
34da10e
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.
It might be better to call public methods in tests instead of protected methods, but I see that that is already an established practice, so there's not much we can do about that. I also have a suggestion for how these tests could be written without the use of promises, but, it's understandable enough without it, so, your call.
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.
Looks good!
this._postMessage(data); | ||
cb(); | ||
} | ||
|
||
_setLogger(log: Log) { |
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.
We should probably stop using _
prefixes, but out of scope for this PR.
Attempt to add support for customizable logger for incoming/outgoing messages.
This will serve other users of this package as well as MetaMask specifically MetaMask/metamask-extension#19325