refactor(cmd): use factories instead of global cobra command structs

This enables us to create new commands for e2e tests.
This commit is contained in:
Julian Tölle 2025-06-15 16:27:31 +02:00
parent fc1ee70c28
commit 94c1aeed55
4 changed files with 111 additions and 95 deletions

23
internal/log/log.go Normal file
View file

@ -0,0 +1,23 @@
package log
import (
"io"
"log/slog"
"os"
"time"
"github.com/lmittmann/tint"
)
func GetLogger(w io.Writer) *slog.Logger {
return slog.New(
tint.NewHandler(w, &tint.Options{
Level: slog.LevelDebug,
TimeFormat: time.RFC3339,
}),
)
}
func init() {
slog.SetDefault(GetLogger(os.Stderr))
}