fix(observabillity): include otel logs
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 5m33s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 5m4s

This commit was merged in pull request #158.
This commit is contained in:
2025-06-07 15:12:18 +02:00
parent e65146c71c
commit 63ade5916e
26 changed files with 231 additions and 185 deletions

View File

@@ -2,18 +2,17 @@ package utils
import (
"fmt"
"log/slog"
"net/http"
"strings"
"time"
"spend-sparrow/internal/log"
)
func TriggerToast(w http.ResponseWriter, r *http.Request, class string, message string) {
if IsHtmx(r) {
w.Header().Set("Hx-Trigger", fmt.Sprintf(`{"toast": "%v|%v"}`, class, strings.ReplaceAll(message, `"`, `\"`)))
} else {
log.L.Error("Trying to trigger toast in non-HTMX request")
slog.Error("Trying to trigger toast in non-HTMX request")
}
}