ayubun / discord-ttl

A simple-to-selfhost Discord bot that deletes server messages older than a configurable TTL (time to live)
MIT License
34 stars 5 forks source link

[repo] switch from `pnpm` to `bun` & improve logging #32

Closed ayubun closed 6 months ago

ayubun commented 6 months ago

Switching pnpm to bun

https://bun.sh/

the name of bun is cute :3 i want their sqlite driver, since it is supposedly quite good, so i'll be using it with the drizzle orm. switching to bun as the package manager is unnecessary for a project this small but something that i wanted to do for fun since bun seems quite good !

Logging

The loggers (both bunny.ts and the global Logger.ts) have been updated to allow for DEBUG, INFO, and ERROR to be enabled/disabled via environment variables (loaded from the .env):

Screenshot 2024-01-14 at 1 11 12 PM Screenshot 2024-01-14 at 1 14 44 PM

Omitting these environment variables will cause the defaults (defined in the code) to be used:

Screenshot 2024-01-14 at 1 13 37 PM

These changes are intend to enable logging configuration for development but it will also allow self hosters to specify their own settings.