pinojs / pino-pretty

🌲Basic prettifier for Pino log lines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--minimumLevel / -L flag doesn't seem to be working

mysticflute opened this issue · comments

I'm using pino-pretty in my project and trying to set the level to debug via a cli flag. I have this in my package.json scripts:

"dev": "next dev | pino-pretty -L debug"

I've tried --minimumLevel=debug, --minimumLevel debug, nothing seems to be working.

I've tried other flags such as -S and they did work.

Using "pino": "^8.11.0" and "pino-pretty": "^9.4.0"

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

Here's a very basic repo... just a node script that outputs to the logger:
https://github.com/mysticflute/pino-pretty-test

Try it with npm test or or node index.js | npx pino-pretty -L debug

You are not setting the log level on the main pino logger, it's not emitting debut level logs.

Are you saying the L flag only operates as a secondary log level, it does not affect the pino log level?

Exactly, they are two separate processes

It is a filter. Note that the help text for that switch indicates so.

Thanks. In hindsight that does make sense. Using both libraries for the first time, I wasn't thinking about how pino-pretty doesn't directly change any of the behavior of pino.