sainsburys-tech / next-logger

JSON logging patcher for Next.js
MIT License
144 stars 14 forks source link

Support Winston as Custom Logger #33

Closed CHC383 closed 2 months ago

CHC383 commented 2 months ago

Partially fix https://github.com/sainsburys-tech/next-logger/issues/29

Description

Fix the code and actually support winston as a custom logger

Testing

CHC383 commented 2 months ago

I added two commits, one for moving pino to peerDeps and one for updating the usage instructions to fix https://github.com/sainsburys-tech/next-logger/issues/13. Please feel free to merge them or I could separate them into another PR depending on your preference.

I tried to update the tests to use the instrumentation hook so that they align with the new instructions, but I couldn't find a good way as the tests invoke the Next logging and console logging directly instead of running the whole Next stack which will load the instrumentation hook. Let me know if you have any thoughts and I am happy to help update the code.

And these are all of my current plans of changes, if there aren't anything new, I think you could bump up the version (5.x? since moving pino could be considered as a breaking change, requiring the users to explicitly install one if they don't already) and make a new release.

atkinchris commented 2 months ago

This is published now as v5.0.0. Thank you @CHC383! 🎉