feat(logger): switch to text handler for slog from tint (#622)

This commit is contained in:
Ayyan 2025-11-16 12:16:16 -05:00 • committed by GitHub
parent eaaf0ac699
commit 6033c923fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,6 @@ import (
"path/filepath"
"github.com/ayn2op/discordo/internal/consts"
"github.com/lmittmann/tint"
)
const fileName = "logs.txt"
@ -27,8 +26,8 @@ func Load(path string, level slog.Level) error {
return fmt.Errorf("failed to open log file: %w", err)
}
opts := &tint.Options{Level: level}
handler := tint.NewHandler(file, opts)
opts := &slog.HandlerOptions{Level: level}
handler := slog.NewTextHandler(file, opts)
slog.SetDefault(slog.New(handler))
return nil
}