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

fix(@libp2p/webrtc): use stream logger instead of global logger #2042

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

achingbrain
Copy link
Member

Streams should use the this.log property for logging to ensure the log messages are scoped to an invidual stream.

Streams should use the `this.log` property for logging to ensure
the log messages are scoped to an invidual stream.
@achingbrain achingbrain requested a review from a team as a code owner September 12, 2023 08:44
Copy link
Member

@maschad maschad left a comment

Choose a reason for hiding this comment

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

This is good, but it's not immediately obvious what the name of the logger would be since it's defined in the superclass, I think you should initialize it separately in the constructor.

@achingbrain
Copy link
Member Author

It's created in the stream factory and passed into the constructor?

@maschad
Copy link
Member

maschad commented Sep 12, 2023

It's less obvious than if it was initialized in the constructor 🤷🏾

@achingbrain
Copy link
Member Author

achingbrain commented Sep 12, 2023

My opinion is not very strong, but as it is it's consistent with yamux and mplex (WebTransport doesn't have per-stream loggers, it should). This can be done as a follow up PR if necessary, it is out of scope here.

@achingbrain achingbrain merged commit 88c47f5 into master Sep 12, 2023
17 checks passed
@achingbrain achingbrain deleted the fix/use-webrtc-stream-logger branch September 12, 2023 15:02
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Sep 27, 2023
…2p#2042)

Streams should use the `this.log` property for logging to ensure
the log messages are scoped to an invidual stream.
This was referenced Jan 18, 2024
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.

2 participants