-
Notifications
You must be signed in to change notification settings - Fork 148
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
Add option for single-line logging of extra attributes #97
Comments
would you like to send a PR?
Il 5 feb 2020, 14:36 +0100, Martin Ždila <notifications@github.com>, ha scritto:
… Logs with multiple extra attributes now take too many lines. Personally prefer buynan formatting.
Example:
logger.info({ id: 22246537, type: 'story' }, 'Saving item.');
Current output with pino-pretty -t -i hostname,pid:
[2020-02-05 13:32:31.528 +0000] INFO : Saving item.
id: 22246537
type: "story"
Preferred output:
[2020-02-05 13:32:31.528 +0000] INFO : Saving item. { id: 22246537, type: "story" }
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thanks. I can try. |
Can someone point me to some files/functions to get started on this feature? |
Lines 122 to 146 in 852fdf7
|
Is anyone working on this? I'd prefer the inline attributes, too! I can work on a PR, but wonder if there is some prior work on this? |
It does not seem anyone is working on this. |
I'm looking into it today |
@mcollina would you like me to add an option or just change the default behavior? I think this change would be a breaking change, but I do prefer the single line output. Maybe we can introduce a new option |
Let's add the option and then discuss the default. I kind of prefer single-line as well, but it's semver major. |
* test: multiline option * Add singleLine option with tests (#97) Co-authored-by: Gregor Martynus <gregor@martynus.net>
Logs with multiple extra attributes now take too many lines. Personally I prefer
buynan
formatting.Example:
Current output with
pino-pretty -t -i hostname,pid
:Preferred output:
The text was updated successfully, but these errors were encountered: