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

Leading space for ignore time and level #129

Closed
davesteinberg opened this issue Sep 5, 2020 · 2 comments
Closed

Leading space for ignore time and level #129

davesteinberg opened this issue Sep 5, 2020 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@davesteinberg
Copy link
Contributor

If I use --ignore tp exclude the time and level, I get an unwanted leading space on each line. For example:

echo '{"level":30,"time":1599275372412,"pid":26631,"hostname":"pb","name":"server","msg":"Hello, world!"}' \
  | npx pino-pretty --ignore "time,level"

This yields:

 (server/26631 on jitterbug): Hello, world!

Note the space at the beginning of the line.

I seem to get this space regardless of whether or not I ignore additional keys or which ones. What I'm actually trying to do is display just the message:

echo '{"level":30,"time":1599275372412,"pid":26631,"hostname":"pb","name":"server","msg":"Hello, world!"}' \
  | npx pino-pretty --ignore "time,level,name,pid,hostname"

Again, this includes a leading space:

 Hello, world!

This seems like a bug, but I'm not sure. Is there a reason for including the space? I'd much prefer not to have it there.

@mcollina
Copy link
Member

mcollina commented Sep 5, 2020

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@mcollina mcollina added bug Something isn't working good first issue Good for newcomers labels Sep 5, 2020
@davesteinberg
Copy link
Contributor Author

@mcollina I'll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants