seriouslysean / monster-hunter-now-events

A tool that auto-generates calendar events for Monster Hunter Now by scraping web news articles, processing them with AI, and creating a convenient calendar subscription.
https://seriouslysean.github.io/monster-hunter-now-events/
MIT License
8 stars 9 forks source link

Define a logging facade and use winston #42

Closed christianfds closed 8 months ago

christianfds commented 8 months ago

Issue

Testing Steps

  1. Run any command to see the logging in action. Or you can run npm run test:logger

Additional Information

  1. You can add a transport layer on winston to handle rollbar though it.

(Sorry it took a while to send the PR, just go around to doing it this afternoon)

christianfds commented 8 months ago

Yes! I didn't add it cause I don't know a lot about the different transports available for this integration.

Winston is a widely supported logging lib in the javascript community, i really liked how it provides the same capabilities of the default logging lib from python, which allows you to handle a single log event in multiple levels and different ways. So if you want, for example, to:

(As you can see I really liked the transport settings xP)

Since it provides all these available configurations, it is better than the console.* for complex/sensitive projects. And the formatting really makes it easier to read the logs, either on console or anywhere else.