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

Dissapering logs with fatal #304

Closed
wiktor-obrebski opened this issue Feb 23, 2022 · 3 comments · Fixed by #316
Closed

Dissapering logs with fatal #304

wiktor-obrebski opened this issue Feb 23, 2022 · 3 comments · Fixed by #316
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@wiktor-obrebski
Copy link

In this example the fatal log never appear:

const pino = require('pino');
const pinoPretty = require('pino-pretty');

const logger = pino(
  { level: 'info' },
  pinoPretty({
    levelFirst: true,
    colorize: true,
    translateTime: 'yyyy-mm-dd HH:MM:ss',
  })
);

logger.info('test 123');
logger.fatal(new Error('not visible'));
process.exit(1)

It's clearly pino-pretty issue, as it does not happen with raw pino.
sync: true, is workaround.

@mcollina mcollina assigned mcollina and unassigned mcollina Feb 23, 2022
@mcollina
Copy link
Member

Thanks, this is working as expected! However we need to add the following block that's missing:

https://github.com/pinojs/pino/blob/f8696ab5fb0e5a819b6255af420b29fb075cbdee/lib/tools.js#L335-L373

@mcollina mcollina added good first issue Good for newcomers bug Something isn't working labels Feb 23, 2022
@edobry
Copy link

edobry commented Mar 2, 2022

hello, I am also facing this issue and I can't get the workaround to work; where exactly do you specify sync: true?

@wiktor-obrebski
Copy link
Author

https://github.com/pinojs/pino-pretty#usage-with-jest
u need to have version 7.5.1 of pino-pretty for this work (with TS)

mcollina added a commit to pinojs/pino that referenced this issue Mar 17, 2022
This is due to pinojs/pino-pretty#304 which
might trigger under severe load and short-lived scripts. The fix
on pino-pretty will happen on its own time but there is no need
to use pino-pretty in these tests.

Fixes #1368
mcollina added a commit to pinojs/pino that referenced this issue Mar 17, 2022
This is due to pinojs/pino-pretty#304 which
might trigger under severe load and short-lived scripts. The fix
on pino-pretty will happen on its own time but there is no need
to use pino-pretty in these tests.

Fixes #1368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants