squeeks / glossy

syslog parser and producer
https://npmjs.org/package/glossy
MIT License
96 stars 29 forks source link

calculatePrival has some bugs #1

Closed tereska closed 13 years ago

tereska commented 13 years ago

https://github.com/squeeks/glossy/blob/master/lib/glossy/produce.js#L415

What if pri.severity is equals 0 (which is severity 'emerg': 0, ) ?? It will become falsy and and will jump to else statment and return false!

the same thing with pri.facility 'kern': 0

squeeks commented 13 years ago

Thanks for spotting this. I'll have a look at fixing it shortly.

squeeks commented 13 years ago

This should hopefully be addressed in 98d4f54744ff807f8c46cba55d1be7174a70df58, let me know if anything else comes up.

Thanks.

tereska commented 13 years ago

it works thanks!

bizob2828 commented 5 years ago

This piece seems to work ok but it depends on how you call produce. I use winston-syslog and it doesn't pass in facility when it calls .produce. So when it gets to this line, https://github.com/squeeks/glossy/blob/master/lib/glossy/produce.js#L154, this.facility is undefined because it will never set this.facility https://github.com/squeeks/glossy/blob/master/lib/glossy/produce.js#L114. It looks like there hasn't been a release in man years but if I open a PR would it get some 👀 ?