fixed list items

This commit is contained in:
2025-02-12 18:16:57 +01:00
parent 157a215e87
commit 8e257639e0
5 changed files with 72 additions and 17 deletions

View File

@@ -24,6 +24,7 @@ import (
"path/filepath"
"runtime/debug"
slogmulti "github.com/samber/slog-multi"
"github.com/spf13/cobra"
"github.com/tlinden/anydb/app"
"github.com/tlinden/anydb/cfg"
@@ -90,13 +91,25 @@ func Execute() {
slog.SetLogLoggerLevel(slog.LevelDebug)
handler := yadu.NewHandler(os.Stdout, opts)
debuglogger := slog.New(handler).With(
dbg, err := os.Create("debug.log")
if err != nil {
return err
}
// FIXME: control this with a flag!
//outhandler := yadu.NewHandler(os.Stdout, opts)
filehandler := yadu.NewHandler(dbg, opts)
debuglogger := slog.New(slogmulti.Fanout(
//outhandler,
filehandler,
)).With(
slog.Group("program_info",
slog.Int("pid", os.Getpid()),
slog.String("go_version", buildInfo.GoVersion),
),
)
slog.SetDefault(debuglogger)
slog.Debug("parsed config", "conf", conf)