-
Notifications
You must be signed in to change notification settings - Fork 885
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
pino.final
without a handler and stream.flushSync()
#1126
Comments
javiertury
changed the title
pino.final and stream.flushSync()
pino.final without a handler and stream.flushSync()
Sep 12, 2021
javiertury
changed the title
pino.final without a handler and stream.flushSync()
Sep 12, 2021
pino.final
without a handler and stream.flushSync()
Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
javiertury
added a commit
to javiertury/pino
that referenced
this issue
Sep 12, 2021
mcollina
pushed a commit
that referenced
this issue
Sep 13, 2021
…1127) * fix: make pino.final sync flushes when no handler provided (#1126) * refactor(final): remove unused error in catch Co-authored-by: James Sumners <[email protected]> Co-authored-by: James Sumners <[email protected]>
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I discovered that pino.final can be used without a handler, which I find very handy. Example:
But reading the code I found something that might be a bug and perhaps someone here can confirm it.
pino/lib/tools.js
Lines 463 to 478 in c57c258
stream.flushSync()
is only called before the handler is executed or afterfinalLogger
is used. In the example above there is no handler andfinalLogger
is only called if there is an error, so when the process exits normally there is no call tostream.flushSync()
.Perhaps the implemention when there is no handler should be this
The text was updated successfully, but these errors were encountered: