Closed avetisk closed 2 years ago
At no point has pino-pretty
ever been intended to be used in a browser environment.
Then you should mention it in the docs.
Because when you read this in the pino
docs:
Pino is compatible with browserify for browser side usage: This can be useful with isomorphic/universal JavaScript code.
You legitimately think that pino-pretty
may also be browser friendly.
pino-pretty
!== pino
It would be nice for it to be compatible in the browser though. Certain frameworks (specifically thinking of Svelte) requires the code to be isomorphic - Pino's great because it's supported on the browser and allows us to use it everywhere. Pretty-printing it on the browser during development would be great.
pino-pretty
has never been intended to be used in a production situation. Also, it is specifically designed for reading input from stdin
and streaming the manipulated data.
I think @DoisKoh is not asking to use pino-pretty in production but in development. No one wants to read unformatted error logs in development. Also @avetisk has a fair point, he is talking about user expectations. Not about about pino === pino-pretty
I do suggest to mention it on the README. or rename this project pino-nodepretty Would save many people a little bit of time :)
Getting the follow error when using in the browser (with Next.js):
While
pino({ prettyPrint: { ... })
is deprecated, it still works properly in the browser.