Sfoglia il codice sorgente

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

Ayyan 5 mesi fa
parent
commit
6033c923fd
1 ha cambiato i file con 2 aggiunte e 3 eliminazioni
  1. 2 3
      internal/logger/logger.go

+ 2 - 3
internal/logger/logger.go

@@ -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
 }