Pino: More human-friendly pino formatting output

Created on 19 Feb 2018  ·  19Comments  ·  Source: pinojs/pino

By default | pino adds extra parameters under msg field. Wonder if it could be hard to change it (extra flag?) so extra parameters are in the same line, but float to the right. I have been using https://github.com/sirupsen/logrus in Go recently, and I do personally find it's formatting easier on the eyes, especially on wider screens.

All 19 comments

I think making the pino cli nicer to read has never been an area were we have invested any amount of time. I’d be happy to see what you came up with.
Worst case, you can always release that as a separate module on npm.

@jsumners what do you think?

Yeah, I realize that. If nobody picks it up next few days-to-weeks, I hope I'll have enough of core job done, so I can sidetrack a bit and fix it myself ;)

I agree. It looks like more and more people are starting to use | pino. So that usage scenario should get some attention. As I mentioned in #360, at a minimum we need to migrate to an easier to maintain parameter solution like https://www.npmjs.com/package/mri.

Make the output easier to read is another excellent goal. It's possible @lrlna would have some input here as well.

I think we should split pino core prettifier into a separate module and then publish additional prettifiers for various needs. Then we bundle a couple of prettifiers with core (or even install on demand npx style). They can then be used similar to how Mocha does reporters

node app.js | pino -P colada

This would pipe through the http://npm.im/pino-colada module which we could package with core (or install on demand as the -P flag is used)

@unjello in your case you could publish a "min" prettifier (pino-pretty-min), node app | pino -P min

also cc @lrlna since we're talking about bundling her prettifier with core - would you be cool with this @lrlna?

--- edit ---
oh jeese @jsumners already cc'd – bit of an eventual consistency collision there

hiya!

I think we should split pino core prettifier into a separate module and then publish additional prettifiers for various needs.

I like this idea a lot! People can do whatever suits their development needs. I normally tell people to use pino-colada with node app.js | pino-colada.

And what does bundling with core mean in this case?

I'd say it means installing it as a (dev?) dependency, and documenting it's usage node app.js | pino -P colada is similar to, say, mocha -R nyan. Currently I'm thinking, by including prettifiers with core and then documenting a list of prettifiers, we're connecting people a little more cohesively with their.. prettification needs. The alternative is to maintain a list of recommended prettifers and say install as needed (much like tap reporters).

@davidmarkclements yea installing as a dev dependency seems quite reasonable to me. Let's do it!

I'm not so keen on including multiple by default. I'd vote 👍 for splitting the current core implementation into a module and making it a dependency. But including any others as a dependency, of any sort, I'd vote 👎.

We already pull in a _lot_ of dev dependencies:
pino zsh

Great feedback. FWIW I really like this idea. To @davidmarkclemens point, I looked (maybe too briefly) but didn’t find pina-colada! Nice one. I’ll work off of this one and try to make my own prettifier for now, and make it fit in the grand plan later

@unjello for other alcohol related puns see http://npm.im/pino-noir 🙃

@mcollina you want to tie break between @jsumners and I regarding bundling prettifiers?

Well, I guess I couldn't help myself: https://www.npmjs.com/package/pino-pretty-min

Especially it turned out simpler then I thought. Also having pino-colada as a scaffolding helped a lot. Thanks @lrlna :) Thank you guys too @davidmarkclements @jsumners @mcollina. I've found a ton of great software thanks to you :)

Not sure if you want to just close this, or use this issue for refactoring you started talking about.

I'm okay with leaving this open unless @davidmarkclements and @mcollina want to start a new issue. I think it's something that should be addressed.

I do agree.

FYI, I'm working on this:

2018-03-27 19-30-41 index js pino-pretty

nice!
Il giorno mer 28 mar 2018 alle 00:31 James Sumners notifications@github.com
ha scritto:

FYI, I'm working on this:

[image: 2018-03-27 19-30-41 index js pino-pretty]
https://user-images.githubusercontent.com/321201/38000415-729d06f6-31f5-11e8-960c-a20be8a4c332.png


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/pinojs/pino/issues/361#issuecomment-376709183, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AADL48EKprcn_eS3fk2gEk_ysfllXe-aks5tisvfgaJpZM4SKsoy
.

Gets resolved by #386.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dunklesToast picture dunklesToast  ·  3Comments

normancarcamo picture normancarcamo  ·  6Comments

sachinavinaw picture sachinavinaw  ·  7Comments

afgallo picture afgallo  ·  4Comments

acro5piano picture acro5piano  ·  3Comments