refactor logger calls

This commit is contained in:
Roman Isaev 2025-01-05 02:24:40 +00:00
parent 7ffb2c1d81
commit c06e0aa206
No known key found for this signature in database
GPG key ID: 7BE2B6A6C89AEC7F
4 changed files with 6 additions and 6 deletions

View file

@ -724,7 +724,7 @@ func AdminUserDevicesDelete(
defer req.Body.Close()
if err = json.NewDecoder(req.Body).Decode(&payload); err != nil {
util.GetLogger(req.Context()).WithError(err).Error("unable to decode device deletion request")
logger.WithError(err).Error("unable to decode device deletion request")
return util.JSONResponse{
Code: http.StatusInternalServerError,
JSON: spec.InternalServerError{},
@ -860,7 +860,7 @@ func AdminCreateOrModifyAccount(req *http.Request, userAPI userapi.ClientUserAPI
DisplayName: r.DisplayName,
}, &res)
if err != nil {
util.GetLogger(req.Context()).WithError(err).Debugln("Failed creating account")
logger.WithError(err).Debugln("Failed creating account")
return util.MessageResponse(http.StatusBadRequest, err.Error())
}
if res.AccountCreated {