podaboutlist / linkfix-for-discord

LinkFix brings link embeds back to your Discord server! Simply post Twitter, Instagram, TikTok, or Reddit links and LinkFix will reply with a rich media embed.
https://discord.com/application-directory/385950397493280805
GNU Affero General Public License v3.0
14 stars 4 forks source link

Get a real logging framework #22

Open RalphORama opened 6 months ago

RalphORama commented 6 months ago

I am writing so many freaking console.debug() statements its crazy. We should implement a structured logging framework.

I don't want to deal with JSON output (even though that may end up being an unwise decision). And timestamps shouldn't be a huge issue since docker [compose] logs has an option to show timestamps.

Some options from a quick "DuckDuckGo" web search:

shoegaze commented 1 month ago

Might be useful down the line to add a environment flag (NODE_ENV = 'development' | 'production') to .env, so we can filter out log levels/reroute output depending on the environment. Seems easy to add afterward, though.

edit: We can probably use the LINKFIX_DEBUG flag in .env for the above, since I don't think we need multiple environments for now.

shoegaze commented 1 month ago

See: https://github.com/shoegaze/linkfix-for-discord/tree/22-add-logging (No PR yet, waiting for #10 to merge)