-
Notifications
You must be signed in to change notification settings - Fork 4
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
Replace Winston Logger with Pino #506
base: dev
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
['uncaughtException', 'unhandledRejection'].forEach(event => | ||
process.on(event, (err, err2) => { | ||
console.error('cli uncaught exception', err, err2); | ||
console.log("A complete log of this run can be found in: \n", logger.getLogFilePath()); |
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.
Good idea
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.
It looks good, but does that mean we can remove the winston
install to reduce package bloat?
Yeah we should, particularly because winston does not work with transport log with process.exit(), better to remove it entirely. Removing it in the next commit |
This PR replaces the current logger (Winston) with (Pino).
The main reason for changing the underlying logger is Winston's issues handling transports alongside process.exit() usage, here's a link to the issue:
winstonjs/winston#228
We use process.exit() in a lot of places throughout the sdk hence using Winston for reliable file log dumping was becoming a problem.
Pino supports process.exit with their transport api making it a better choice for maintain log dump file.
** The error in the image was for testing purposes, the chat code works fine as expected