feat: colorize log output

Makes it easier to read, uses lmittmann/tint.
This commit is contained in:
Julian Tölle 2025-06-14 15:04:44 +02:00
parent e59b1eb34d
commit 72e1d5a320
3 changed files with 12 additions and 3 deletions

View file

@ -7,7 +7,9 @@ import (
"os/signal"
"runtime/debug"
"syscall"
"time"
"github.com/lmittmann/tint"
"github.com/spf13/cobra"
)
@ -76,8 +78,12 @@ func Execute() {
}
func init() {
logger = slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{
Level: slog.LevelDebug,
}))
logger = slog.New(
tint.NewHandler(os.Stderr, &tint.Options{
Level: slog.LevelDebug,
TimeFormat: time.RFC3339,
}),
)
slog.SetDefault(logger)
}