You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
wrangler dev | pino-pretty
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!
The text was updated successfully, but these errors were encountered:
Describe the solution
I really like to use
pino
as my main logger. Pino has a neat package calledpino-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: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 | pino-pretty
I did some debugging with a local fork of
pino-pretty
and it looks likepino-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!
The text was updated successfully, but these errors were encountered: