Skip to content
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

always sync flush fatal log messages #730

Merged
merged 2 commits into from Oct 14, 2019
Merged

Conversation

davidmarkclements
Copy link
Member

it occurred to me today that if you ever write a fatal log, it's because the server is crashing or because you need to crash the server.

e.g.

if (thisIsAnImpossibleSituation) {
  pino.fatal(`there's no where to go, we have to crash`)
  process.exit(1)
}

In this scenario, we always want to sync flush, and there's no legit scenarios where fatal would be used other than in a death spiral.

docs/api.md Outdated Show resolved Hide resolved
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting here that this usage of fatal is basically the standard assumption -- https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#FATAL

The FATAL level designates very severe error events that will presumably lead the application to abort.

That being said, I would consider this change a semver major change since it alters the behavior of the method.

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants