feat: image gallery (#2)
/ publish (push) Successful in 4m4s

Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-06-01 14:07:50 +02:00
parent ee3eba3cd9
commit 763163c24e
30 changed files with 513 additions and 44 deletions
+20 -5
View File
@@ -30,11 +30,7 @@ func main() {
slog.Error("could not read configuaration", "err", err)
}
slog.SetDefault(
slog.New(
slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: cfg.LogLevel}),
),
)
setupLogger(&cfg)
err = server.Start(ctx, cfg)
if err != nil {
@@ -42,3 +38,22 @@ func main() {
return
}
}
func setupLogger(cfg *config.Cfg) {
opts := slog.HandlerOptions{
Level: cfg.LogLevel,
}
var handler slog.Handler
if cfg.LogJSON {
handler = slog.NewJSONHandler(os.Stdout, &opts)
} else {
handler = slog.NewTextHandler(os.Stdout, &opts)
}
slog.SetDefault(
slog.New(
handler,
),
)
}