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

🚀 Feature Request: Support for pino-pretty #6841

Open
thijserven opened this issue Sep 26, 2024 · 0 comments
Open

🚀 Feature Request: Support for pino-pretty #6841

thijserven opened this issue Sep 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@thijserven
Copy link

Describe the solution

I really like to use pino as my main logger. Pino has a neat package called pino-pretty which transforms an object-style log into a log that's more readable for humans (while developing locally).

So when you want to run pino-pretty in a node application, you can simply do: node index.js | pino-pretty and it will format logs that look like this:

{
  time: 1727371955216,
  level: 'DEBUG',
  msg: 'test',
  requestId: '21227132-2c8b-4b69-b6cc-d6adfa9f1d2e'
}

Into something like this:
[19:37:36.190] DEBUG (57500): test

Now this works very well when running "standard" node applications. But when I try to run pino-pretty alongside wrangler (wrangler dev | pino-pretty) it doesn't work. Wrangler's default log coloring disappears and pino-pretty has no effect.

wrangler dev

Screenshot 2024-09-26 at 19 40 21

wrangler dev | pino-pretty

Screenshot 2024-09-26 at 19 40 55

I did some debugging with a local fork of pino-pretty and it looks like pino-pretty can't read the console log stream when wrangler dev is running. My guess is that wrangler dev takes over the entire console log stream after initializing.

Is there some already existing way that I can run wrangler and pino-pretty alongside each other? If not it would be very nice if this will be supported eventually.

Thanks!

@thijserven thijserven added the enhancement New feature or request label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant