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
refactor(microservices): disable ping timer message in nats by flag #10798
refactor(microservices): disable ping timer message in nats by flag #10798
Conversation
if (status.type === 'pingTimer' && this.options.debug) { | ||
this.logger.debug( | ||
`NatsStatus: type: "${status.type}", data: "${data}".`, | ||
); |
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.
What about errors not of type pingTimer
?
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.
True, I missed it. I will fix it. What do you think about switch case for everyone status type? I guess its will be more clear for understanding about logic in handleStatusUpdates.
Example:
switch (status.type) {
case 'error':
case 'disconnect':
this.logger.error(
`NatsError: type: "${status.type}", data: "${data}".`
);
break;
case 'pingTimer':
if (this.options.debug) {
this.logger.debug(
`NatsStatus: type: "${status.type}", data: "${data}".`
);
}
break;
default:
this.logger.log(
`NatsStatus: type: "${status.type}", data: "${data}".`
);
break;
}
Pull Request Test Coverage Report for Build ba2623a9-72df-472a-80de-48f52028c6d2
💛 - Coveralls |
@kamilmysliwiec what do you think of the solution @andreyddk provided? |
@kamilmysliwiec any news here? |
LGTM |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The debug message of nats server is annoying and its cant be disabled.
DEBUG [Server] NatsStatus: type: "pingTimer", data: "1".
Issue Number: 10783
What is the new behavior?
My propose it is extends the implementation existed flag debug of MicroserviceOptions for disable pingTimer message.
Does this PR introduce a breaking change?
Other information