-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
There was a problem hiding this 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?
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 : '-' |
There was a problem hiding this comment.
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 || '-'
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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. |
Thank you for adding this missing feature. I couldn't agree more about Pino. |
BTW I'll publish a release when I have some free time to do so. |
Thanks! |
Published as v1.2.0. |
I need this field in order to send my customer token and tags to Loggly so I figure others may need it as well.