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

Easiest way to process.exit on with consola.fatal #314

Open
uncenter opened this issue Aug 9, 2024 · 0 comments
Open

Easiest way to process.exit on with consola.fatal #314

uncenter opened this issue Aug 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@uncenter
Copy link

uncenter commented Aug 9, 2024

Environment

N/A

Reproduction

N/A

Describe the bug

I'm a bit confused on how I can get consola.fatal to log and then fail the process. I was surprised to see that, as far as I can tell, fatal is identical to error? I would expect different behavior, such as exiting by default!

Additional context

While searching this repo for this behavior I came across #30 (comment):

consola.on('fatal', (message) => {
   process.exit(1)
})

I really like this (nonexistent) API. I found _wrapLogFn but it doesn't seem applicable here.

Logs

No response

@uncenter uncenter added the bug Something isn't working label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant