fix(observabillity): include otel logs
This commit was merged in pull request #158.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user