Closed mcollina closed 2 years ago
cc @onkeltem
Great, thanks. It works:
import pino from 'pino';
import pretty from 'pino-pretty';
const logger = pino(pretty({sync: true}));
logger.info('Line 1');
console.log('Line 1');
logger.info('Line 2');
console.log('Line 2');
logger.info('Line 3');
console.log('Line 3');
Output:
$ npx ts-node log-test.ts
[1642734910384] INFO (15467 on fractal): Line 1
Line 1
[1642734910386] INFO (15467 on fractal): Line 2
Line 2
[1642734910386] INFO (15467 on fractal): Line 3
Line 3
Before it was:
$ npx ts-node log-test.ts
Line 1
Line 2
Line 3
[1642735523945] INFO (19553 on fractal): Line 1
[1642735523946] INFO (19553 on fractal): Line 2
[1642735523946] INFO (19553 on fractal): Line 3
Fixes: https://github.com/pinojs/pino-pretty/issues/296