aboutsummaryrefslogtreecommitdiffstats
path: root/api/handler/site.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/handler/site.go')
-rw-r--r--api/handler/site.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/api/handler/site.go b/api/handler/site.go
index abdc0de..27968d7 100644
--- a/api/handler/site.go
+++ b/api/handler/site.go
@@ -3,6 +3,7 @@ package handler
import (
"crypto/subtle"
"fmt"
+ "log/slog"
"net/http"
"strings"
@@ -25,6 +26,7 @@ func UploadSiteVersion(mainConfig *config.MainConfig, index *index.SiteIndex) fu
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprintf(w, "could not read stream: %s", err.Error())
+ slog.Error("could not read stream", "remoteAddr", r.RemoteAddr, "error", err)
return
}
@@ -32,9 +34,11 @@ func UploadSiteVersion(mainConfig *config.MainConfig, index *index.SiteIndex) fu
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, err.Error())
+ slog.Error("could not handle upload", "remoteAddr", r.RemoteAddr, "error", err)
return
}
+ slog.Info("new version created", "site", site, "version", version, "remoteAddr", r.RemoteAddr)
fmt.Fprintf(w, "version created: %s", version)
}
}