From c69fce6edaaefbe07fdbe7b1b0bd83021b5b095c Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Fri, 8 Mar 2024 11:44:49 +0100 Subject: [PATCH] debugging --- api.go | 8 ++++++++ web.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api.go b/api.go index 9b1b9f1..8797f76 100644 --- a/api.go +++ b/api.go @@ -13,6 +13,9 @@ import ( "github.com/ssgreg/journald" ) +// TODO: make toggleable. +var DEBUG bool + func processSentryRequest(w http.ResponseWriter, r *http.Request) { projectID := chi.URLParam(r, "projectID") // These can be provided here, @@ -97,6 +100,11 @@ func processSentryRequest(w http.ResponseWriter, r *http.Request) { http.Error(w, "Error parsing event", http.StatusBadRequest) } + if DEBUG { + fmt.Printf("Received %s event\n", msg_type.Type) + fmt.Println(string(v[2])) + } + journal_metadata := map[string]interface{}{ "SENTRY_KEY": sentry_key, "SENTRY_VERSION": sentry_version, diff --git a/web.go b/web.go index 0620d8f..7b60ed3 100644 --- a/web.go +++ b/web.go @@ -6,8 +6,8 @@ import ( "net/http" "text/template" - "github.com/go-chi/chi/v5" "embed" + "github.com/go-chi/chi/v5" ) //go:embed templates