mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
refactor logger calls
This commit is contained in:
parent
7ffb2c1d81
commit
c06e0aa206
4 changed files with 6 additions and 6 deletions
|
@ -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 {
|
||||
|
|
|
@ -173,7 +173,6 @@ func (m *MSC3861UserVerifier) getUserByAccessToken(ctx context.Context, token st
|
|||
logger.WithError(err).Error("MSC3861UserVerifier:introspectToken")
|
||||
return nil, err
|
||||
}
|
||||
logger.Debugf("Introspection result: %+v", *introspectionResult)
|
||||
|
||||
if !introspectionResult.Active {
|
||||
return nil, &mscError{Code: codeInvalidClientToken, Msg: "Token is not active"}
|
||||
|
|
|
@ -471,10 +471,11 @@ func (a *UserInternalAPI) processOtherSignatures(
|
|||
func (a *UserInternalAPI) crossSigningKeysFromDatabase(
|
||||
ctx context.Context, req *api.QueryKeysRequest, res *api.QueryKeysResponse,
|
||||
) {
|
||||
logger := logrus.WithContext(ctx)
|
||||
for targetUserID := range req.UserToDevices {
|
||||
keys, err := a.KeyDatabase.CrossSigningKeysForUser(ctx, targetUserID)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Errorf("Failed to get cross-signing keys for user %q", targetUserID)
|
||||
logger.WithError(err).Errorf("Failed to get cross-signing keys for user %q", targetUserID)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -487,7 +488,7 @@ func (a *UserInternalAPI) crossSigningKeysFromDatabase(
|
|||
|
||||
sigMap, err := a.KeyDatabase.CrossSigningSigsForTarget(ctx, req.UserID, targetUserID, keyID)
|
||||
if err != nil && err != sql.ErrNoRows {
|
||||
logrus.WithError(err).Errorf("Failed to get cross-signing signatures for user %q key %q", targetUserID, keyID)
|
||||
logger.WithError(err).Errorf("Failed to get cross-signing signatures for user %q key %q", targetUserID, keyID)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ func (a *UserInternalAPI) QueryKeys(ctx context.Context, req *api.QueryKeysReque
|
|||
DeviceIDs: dids,
|
||||
}, &queryRes)
|
||||
if err != nil {
|
||||
util.GetLogger(ctx).Warnf("Failed to QueryDeviceInfos for device IDs, display names will be missing")
|
||||
util.GetLogger(ctx).WithError(err).Warnf("Failed to QueryDeviceInfos for device IDs, display names will be missing")
|
||||
}
|
||||
|
||||
if res.DeviceKeys[userID] == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue