Skip to content

Conversation

@mondoreale
Copy link
Contributor

@mondoreale mondoreale commented Dec 26, 2025

This pull request primarily standardizes how loggers are initialized across the codebase by using explicit string names instead of the module object. This change improves clarity and consistency in log output, making it easier to identify log sources. Additionally, a related test has been updated to match the new logger initialization approach.

Changes

Logger initialization standardization:

  • Changed logger initialization in WebrtcConnector.ts to use the explicit string 'WebrtcConnector' instead of passing the module object.
  • Changed logger initialization in browser-smoke-test/server.js to use the explicit string 'browser-smoke-test/server' instead of passing the module object.

Test updates:

  • Updated the Logger test in Logger.test.ts to expect logger names created from strings instead of the module object.

Future steps

  • We may want to stick to string-based scopes/modules to be explicit. This way we could also simplify Logger#createName.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR completes the migration from using the deprecated module object to explicit string-based identifiers for logger initialization. This improves log readability and standardizes logging practices across the codebase.

  • Updated logger initialization in WebrtcConnector.ts to use the class name
  • Updated logger initialization in the browser smoke test server to use a path-based identifier

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/dht/src/connection/webrtc/WebrtcConnector.ts Changed logger initialization from module to explicit string 'WebrtcConnector', consistent with other connector classes
packages/sdk/test/browser-smoke-test/server.js Changed logger initialization from module to explicit string 'browser-smoke-test/server', using a path-based naming convention

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added the utils label Dec 26, 2025
@mondoreale mondoreale merged commit 01185d0 into main Dec 26, 2025
42 of 43 checks passed
@mondoreale mondoreale deleted the avoid-remaining-module branch December 26, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dht Related to DHT package sdk utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants