bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
797 stars 187 forks source link

Supporting custom status levels #102

Closed cressie176 closed 8 years ago

cressie176 commented 8 years ago

I'd like to downgrade successful responses to "debug" so I can filter them out from our logstash transport, while retaining our own info messages. This PR allows users to set the log level for successes, warnings and errors

floatingLomas commented 8 years ago

This looks fine to me, but please squash your commits first.

rosston commented 8 years ago

Thanks for contributing! I like the idea, and it looks good to me too. But please add tests and update the README to document the new feature as well. I think for the documentation, you can just specify another possible value for statusLevels in the Options section.

cressie176 commented 8 years ago

Thanks for considering. No problem squashing commits or updating the README. I'll have a look at the tests too. There's nothing existing for the statusLevel feature to base them on so not sure how easy they'll be.

rosston commented 8 years ago

That's actually a fair point about the tests. @floatingLomas has contemplated refactoring them in #60, and I've been thinking about it as well.

They're pretty messy as is. Maybe feel free to skip adding tests? I can add tests post-merge. And maybe that'll motivate me to finally tackle refactoring the tests. :)

cressie176 commented 8 years ago

OK. Commits squashed and readme updated.

bithavoc commented 8 years ago

:+1:

rosston commented 8 years ago

Sorry, I forgot to publish on npm after this first got merged. Now published in v1.3.0.

cressie176 commented 8 years ago

No problems. I've done that so many times it's not funny!