pino icon indicating copy to clipboard operation
pino copied to clipboard

feat: support for `maxLevel` in multistream

Open robertsLando opened this issue 3 years ago • 7 comments
trafficstars

Fixes #1271

robertsLando avatar Dec 28 '21 17:12 robertsLando

@jsumners Documentation added. Would like to know @mcollina opinion about allowedLevels, IMO it's not necessary

robertsLando avatar Dec 29 '21 07:12 robertsLando

I would recommend we rename level to minLevel (aliasing it) to clarify it further.

Do you mean in StreamEntry or in internal stream array? If the first one do you plan to keep a back compatibility or a breaking change?

robertsLando avatar Dec 29 '21 08:12 robertsLando

I'm not sure what StreamEntry is. I mean the same object where you added maxLevel. We would need to maintain backward compatibility.

mcollina avatar Dec 29 '21 10:12 mcollina

@mcollina StreamEntry it's the type of the streams passed as object in multistream: https://github.com/pinojs/pino/blob/master/pino.d.ts#L249

The type could be that one or DestinationStream

BTW I can do that now or could we merge this and keep that for another PR?

robertsLando avatar Dec 29 '21 10:12 robertsLando

I'd prefer to have it in this PR.

mcollina avatar Dec 29 '21 10:12 mcollina

@mcollina LGTM or should we change the implementation like @jsumners suggested?

robertsLando avatar Dec 30 '21 09:12 robertsLando

I think @jsumners objection is valid, so let's implement that instead.

mcollina avatar Dec 30 '21 09:12 mcollina

In case we are looking for more feedback. How about using the existing level property, but allowing it to be an object as well with the following properties.

level: { min: 'info', max: 'warn' }

thetutlage avatar Nov 09 '22 09:11 thetutlage

@thetutlage I think this PR stalled. Would you like to send a fresh one?

mcollina avatar Nov 09 '22 09:11 mcollina

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[bot] avatar Nov 10 '23 00:11 github-actions[bot]