bithavoc / express-winston

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

Match colorize output with Morgan #154

Open Hilzu opened 7 years ago

Hilzu commented 7 years ago

Morgan only colors the status code in the log message according to code, documentation and quick testing. This PR makes the log output when using the colorize option to match it. IMHO this also makes the output a lot more readable because the current setting of grey on black has really low contrast with many color themes.

rosston commented 7 years ago

Awesome, thanks for contributing! I'm happy with this change since it improves contrast and readability.

The only thing I'm worried about is that this is technically a breaking change. I'd love to merge it soon, but I have some more breaking changes in mind for express-winston v3. I think I'm going to hold off for now, but I may end up changing my mind later just to get this in. 🙂

Hilzu commented 7 years ago

Would you also consider matching expressFormat with morgan in v3? Currently it matches the morgan dev format but it's missing content length from the end. I can create a PR if you agree that it should be done.

rosston commented 7 years ago

@Hilzu Sorry, responding very late.

I'm torn on adding the content length to be on by default with expressFormat. I started writing a longer response but ended up deleting it (that's how torn I am).

I'm good with adding content length to expressFormat, but I'm inclined to hold off on that until a v3 release as well. I know it's kind of pedantic, but I don't really want to mess with the log formats of people's files without a major version bump.

jblevins1991 commented 4 years ago

This is a very old PR. What are we doing with this?