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

Adds support for the RFC5424 structured data field #4

Merged
merged 2 commits into from
Jan 22, 2018

Conversation

zol
Copy link
Contributor

@zol zol commented Jan 20, 2018

I need this field in order to send my customer token and tags to Loggly so I figure others may need it as well.

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Can you add a unit test for the feature?

@zol
Copy link
Contributor Author

zol commented Jan 20, 2018

Sure, how lazy of me not to!

lib/rfc5424.js Outdated
@@ -35,7 +35,7 @@ module.exports = function ($options) {
const hostname = data.hostname
const appname = (options.appname !== 'none') ? options.appname : '-'
const msgid = (data.req && data.req.id) ? data.req.id : '-'
const structuredData = '-'
const structuredData = (options.structuredData !== 'none') ? options.structuredData : '-'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why check for a string'none' instead of a falsy value here? e.g:

const structuredData = options.structuredData  || '-'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how I'd write it normally but instead copied the style you used with appname as I figured you had a reason for defining configuration options that way. Now that you mention it I'm curious why you did it like that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, it looks like I did do that. It's been so long since I wrote this. I'm fine with you correcting the style.

@zol
Copy link
Contributor Author

zol commented Jan 22, 2018

Made the changes you requested. Thanks for working on this project and pino. I love the design philosophy and implementation behind pino, I think it's one of the best pieces of software in the Node ecosystem.

@jsumners
Copy link
Member

Thank you for adding this missing feature. I couldn't agree more about Pino.

@jsumners jsumners merged commit 79febd5 into pinojs:master Jan 22, 2018
@jsumners
Copy link
Member

BTW I'll publish a release when I have some free time to do so.

@zol
Copy link
Contributor Author

zol commented Jan 22, 2018

Thanks!

@jsumners
Copy link
Member

Published as v1.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants