feat(logger): switch to text handler for slog from tint (#622)
This commit is contained in:
parent
eaaf0ac699
commit
6033c923fd
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue