fix(observabillity): include otel logs
This commit was merged in pull request #158.
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"spend-sparrow/internal/handler/middleware"
|
||||
"spend-sparrow/internal/log"
|
||||
"spend-sparrow/internal/service"
|
||||
"spend-sparrow/internal/template/auth"
|
||||
"spend-sparrow/internal/types"
|
||||
"spend-sparrow/internal/utils"
|
||||
|
||||
"errors"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -168,7 +167,7 @@ func (handler AuthImpl) handleVerifyResendComp() http.HandlerFunc {
|
||||
|
||||
_, err := w.Write([]byte("<p class=\"mt-8\">Verification email sent</p>"))
|
||||
if err != nil {
|
||||
log.L.Error("Could not write response", "err", err)
|
||||
slog.Error("Could not write response", "err", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -203,13 +202,13 @@ func (handler AuthImpl) handleSignUp() http.HandlerFunc {
|
||||
var password = r.FormValue("password")
|
||||
|
||||
_, err := utils.WaitMinimumTime(securityWaitDuration, func() (any, error) {
|
||||
log.L.Info("signing up", "email", email)
|
||||
slog.Info("signing up", "email", email)
|
||||
user, err := handler.service.SignUp(email, password)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.L.Info("Sending verification email", "to", user.Email)
|
||||
slog.Info("Sending verification email", "to", user.Email)
|
||||
go handler.service.SendVerificationMail(user.Id, user.Email)
|
||||
return nil, nil
|
||||
})
|
||||
@@ -389,7 +388,7 @@ func (handler AuthImpl) handleForgotPasswordResponseComp() http.HandlerFunc {
|
||||
|
||||
pageUrl, err := url.Parse(r.Header.Get("Hx-Current-Url"))
|
||||
if err != nil {
|
||||
log.L.Error("Could not get current URL", "err", err)
|
||||
slog.Error("Could not get current URL", "err", err)
|
||||
utils.TriggerToastWithStatus(w, r, "error", "Internal Server Error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user