Skip to content
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

Merged
merged 7 commits into from
Jun 15, 2023

Conversation

weizman
Copy link
Member

@weizman weizman commented May 29, 2023

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

@weizman weizman marked this pull request as ready for review May 29, 2023 17:22
@weizman weizman changed the title [draft] support logger poc Support for customizable logger for incoming/outgoing messages May 29, 2023
}

private _log(data: StreamData, out: boolean) {
this._logger.logger(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fair
34da10e

@weizman weizman requested a review from mcmire June 6, 2023 10:02
mcmire
mcmire previously approved these changes Jun 6, 2023
Copy link

@mcmire mcmire left a 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.

@weizman weizman requested a review from mcmire June 7, 2023 10:42
Copy link

@mcmire mcmire left a 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) {
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants