Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
avaer
reviewed
Nov 11, 2024
| ['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()); |
avaer
reviewed
Nov 11, 2024
Contributor
avaer
left a comment
There was a problem hiding this comment.
It looks good, but does that mean we can remove the winston install to reduce package bloat?
Contributor
Author
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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