-
Notifications
You must be signed in to change notification settings - Fork 13
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
chore: improve websocket logs #416
base: old-dev
Are you sure you want to change the base?
Conversation
@@ -186,6 +186,8 @@ abstract class BaseWebSocket extends EventEmitter { | |||
this.heartbeat = setInterval(() => { | |||
this.sendPing(); | |||
}, this.heartbeatInterval); | |||
|
|||
console.info('Websocket connection opened.'); |
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.
I know we are already logging the websocket ping timeout, but I don't like the idea of having logs on the lib, it pollutes the sdout of the clients using it
Maybe we should just emit an event here and log on the client
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.
If we decide to emit an event to log something, I would suggest to create an util logger
that centralizes all the logging on the lib and implements this event emit with the common interface of log
, warn
, error
, etc.
That way we can have a familiar logging structure within the lib, just as if it was a common application, and have the centralized logger deal with the events. This would also make it easier for future logging configurations.
Codecov Report
@@ Coverage Diff @@
## dev #416 +/- ##
=======================================
Coverage 56.68% 56.68%
=======================================
Files 55 55
Lines 4603 4604 +1
Branches 879 879
=======================================
+ Hits 2609 2610 +1
Misses 1804 1804
Partials 190 190
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Acceptance Criteria
Security Checklist