pinojs / pino-tee

🌲 tee pino logs into a file, with multiple levels
MIT License
89 stars 17 forks source link

stream.PassThrough() error using with pino #15

Closed AaronPorts closed 3 years ago

AaronPorts commented 4 years ago

I receive next error when I try to run code for Node from usage example: Error: final requires a stream that has a flushSync method, such as pino.destination and pino.extreme

My code is the same, except that I use es6 import syntax:

import pino from "pino";
import { PassThrough } from "stream";
...
const logThrough = new PassThrough();
const logger = pino({name: 'project'}, logThrough);
mcollina commented 4 years ago

I don't understand why you are opening this issue in this repo. Has this anything to do with pino-tee? Can you upload a full example to reproduce?

salmanm commented 3 years ago

It seems to be a stale one. I've added an ESM example in https://github.com/pinojs/pino-tee/pull/18 and it works fine.