mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
NOISSUE - Fix failed log message (#2307)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
This commit is contained in:
+25
-25
@@ -34,7 +34,7 @@ func (lm *loggingMiddleware) ListObjects(ctx context.Context, pr auth.PolicyReq,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List objects failed to complete successfully", args...)
|
||||
lm.logger.Warn("List objects failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List objects completed successfully", args...)
|
||||
@@ -56,7 +56,7 @@ func (lm *loggingMiddleware) ListAllObjects(ctx context.Context, pr auth.PolicyR
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List all objects failed to complete successfully", args...)
|
||||
lm.logger.Warn("List all objects failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List all objects completed successfully", args...)
|
||||
@@ -72,7 +72,7 @@ func (lm *loggingMiddleware) CountObjects(ctx context.Context, pr auth.PolicyReq
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Count objects failed to complete successfully", args...)
|
||||
lm.logger.Warn("Count objects failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Count objects completed successfully", args...)
|
||||
@@ -87,7 +87,7 @@ func (lm *loggingMiddleware) ListSubjects(ctx context.Context, pr auth.PolicyReq
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List subjects failed to complete successfully", args...)
|
||||
lm.logger.Warn("List subjects failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List subjects completed successfully", args...)
|
||||
@@ -109,7 +109,7 @@ func (lm *loggingMiddleware) ListAllSubjects(ctx context.Context, pr auth.Policy
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List all subjects failed to complete successfully", args...)
|
||||
lm.logger.Warn("List all subjects failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List all subjects completed successfully", args...)
|
||||
@@ -125,7 +125,7 @@ func (lm *loggingMiddleware) CountSubjects(ctx context.Context, pr auth.PolicyRe
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Count subjects failed to complete successfully", args...)
|
||||
lm.logger.Warn("Count subjects failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Count subjects completed successfully", args...)
|
||||
@@ -147,7 +147,7 @@ func (lm *loggingMiddleware) ListPermissions(ctx context.Context, pr auth.Policy
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List permissions failed to complete successfully", args...)
|
||||
lm.logger.Warn("List permissions failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List permissions completed successfully", args...)
|
||||
@@ -167,7 +167,7 @@ func (lm *loggingMiddleware) Issue(ctx context.Context, token string, key auth.K
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Issue key failed to complete successfully", args...)
|
||||
lm.logger.Warn("Issue key failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Issue key completed successfully", args...)
|
||||
@@ -184,7 +184,7 @@ func (lm *loggingMiddleware) Revoke(ctx context.Context, token, id string) (err
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Revoke key failed to complete successfully", args...)
|
||||
lm.logger.Warn("Revoke key failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Revoke key completed successfully", args...)
|
||||
@@ -201,7 +201,7 @@ func (lm *loggingMiddleware) RetrieveKey(ctx context.Context, token, id string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Retrieve key failed to complete successfully", args...)
|
||||
lm.logger.Warn("Retrieve key failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Retrieve key completed successfully", args...)
|
||||
@@ -221,7 +221,7 @@ func (lm *loggingMiddleware) Identify(ctx context.Context, token string) (id aut
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Identify key failed to complete successfully", args...)
|
||||
lm.logger.Warn("Identify key failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Identify key completed successfully", args...)
|
||||
@@ -247,7 +247,7 @@ func (lm *loggingMiddleware) Authorize(ctx context.Context, pr auth.PolicyReq) (
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Authorize failed to complete successfully", args...)
|
||||
lm.logger.Warn("Authorize failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Authorize completed successfully", args...)
|
||||
@@ -269,7 +269,7 @@ func (lm *loggingMiddleware) AddPolicy(ctx context.Context, pr auth.PolicyReq) (
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Add policy failed to complete successfully", args...)
|
||||
lm.logger.Warn("Add policy failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Add policy completed successfully", args...)
|
||||
@@ -284,7 +284,7 @@ func (lm *loggingMiddleware) AddPolicies(ctx context.Context, prs []auth.PolicyR
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn(fmt.Sprintf("Add %d policies failed to complete successfully", len(prs)), args...)
|
||||
lm.logger.Warn(fmt.Sprintf("Add %d policies failed", len(prs)), args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info(fmt.Sprintf("Add %d policies completed successfully", len(prs)), args...)
|
||||
@@ -307,7 +307,7 @@ func (lm *loggingMiddleware) DeletePolicyFilter(ctx context.Context, pr auth.Pol
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Delete policy filter failed to complete successfully", args...)
|
||||
lm.logger.Warn("Delete policy filter failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Delete policy filter completed successfully", args...)
|
||||
@@ -322,7 +322,7 @@ func (lm *loggingMiddleware) DeletePolicies(ctx context.Context, prs []auth.Poli
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn(fmt.Sprintf("Delete %d policies failed to complete successfully", len(prs)), args...)
|
||||
lm.logger.Warn(fmt.Sprintf("Delete %d policies failed", len(prs)), args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info(fmt.Sprintf("Delete %d policies completed successfully", len(prs)), args...)
|
||||
@@ -341,7 +341,7 @@ func (lm *loggingMiddleware) CreateDomain(ctx context.Context, token string, d a
|
||||
}
|
||||
if err != nil {
|
||||
args := append(args, slog.String("error", err.Error()))
|
||||
lm.logger.Warn("Create domain failed to complete successfully", args...)
|
||||
lm.logger.Warn("Create domain failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Create domain completed successfully", args...)
|
||||
@@ -357,7 +357,7 @@ func (lm *loggingMiddleware) RetrieveDomain(ctx context.Context, token, id strin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Retrieve domain failed to complete successfully", args...)
|
||||
lm.logger.Warn("Retrieve domain failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Retrieve domain completed successfully", args...)
|
||||
@@ -373,7 +373,7 @@ func (lm *loggingMiddleware) RetrieveDomainPermissions(ctx context.Context, toke
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Retrieve domain permissions failed to complete successfully", args...)
|
||||
lm.logger.Warn("Retrieve domain permissions failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Retrieve domain permissions completed successfully", args...)
|
||||
@@ -392,7 +392,7 @@ func (lm *loggingMiddleware) UpdateDomain(ctx context.Context, token, id string,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update domain failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update domain failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update domain completed successfully", args...)
|
||||
@@ -412,7 +412,7 @@ func (lm *loggingMiddleware) ChangeDomainStatus(ctx context.Context, token, id s
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Change domain status failed to complete successfully", args...)
|
||||
lm.logger.Warn("Change domain status failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Change domain status completed successfully", args...)
|
||||
@@ -432,7 +432,7 @@ func (lm *loggingMiddleware) ListDomains(ctx context.Context, token string, page
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List domains failed to complete successfully", args...)
|
||||
lm.logger.Warn("List domains failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List domains completed successfully", args...)
|
||||
@@ -450,7 +450,7 @@ func (lm *loggingMiddleware) AssignUsers(ctx context.Context, token, id string,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Assign users to domain failed to complete successfully", args...)
|
||||
lm.logger.Warn("Assign users to domain failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Assign users to domain completed successfully", args...)
|
||||
@@ -468,7 +468,7 @@ func (lm *loggingMiddleware) UnassignUsers(ctx context.Context, token, id string
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Unassign users to domain failed to complete successfully", args...)
|
||||
lm.logger.Warn("Unassign users to domain failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Unassign users to domain completed successfully", args...)
|
||||
@@ -484,7 +484,7 @@ func (lm *loggingMiddleware) ListUserDomains(ctx context.Context, token, userID
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List user domains failed to complete successfully", args...)
|
||||
lm.logger.Warn("List user domains failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List user domains completed successfully", args...)
|
||||
|
||||
+14
-14
@@ -35,7 +35,7 @@ func (lm *loggingMiddleware) Add(ctx context.Context, token string, cfg bootstra
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Add new bootstrap failed to complete successfully", args...)
|
||||
lm.logger.Warn("Add new bootstrap failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Add new bootstrap completed successfully", args...)
|
||||
@@ -54,7 +54,7 @@ func (lm *loggingMiddleware) View(ctx context.Context, token, id string) (saved
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View thing config failed to complete successfully", args...)
|
||||
lm.logger.Warn("View thing config failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View thing config completed successfully", args...)
|
||||
@@ -76,7 +76,7 @@ func (lm *loggingMiddleware) Update(ctx context.Context, token string, cfg boots
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update bootstrap config failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update bootstrap config failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update bootstrap config completed successfully", args...)
|
||||
@@ -95,7 +95,7 @@ func (lm *loggingMiddleware) UpdateCert(ctx context.Context, token, thingID, cli
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update bootstrap config certificate failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update bootstrap config certificate failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update bootstrap config certificate completed successfully", args...)
|
||||
@@ -115,7 +115,7 @@ func (lm *loggingMiddleware) UpdateConnections(ctx context.Context, token, id st
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update config connections failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update config connections failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update config connections completed successfully", args...)
|
||||
@@ -139,7 +139,7 @@ func (lm *loggingMiddleware) List(ctx context.Context, token string, filter boot
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List configs failed to complete successfully", args...)
|
||||
lm.logger.Warn("List configs failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List configs completed successfully", args...)
|
||||
@@ -158,7 +158,7 @@ func (lm *loggingMiddleware) Remove(ctx context.Context, token, id string) (err
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Remove bootstrap config failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove bootstrap config failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove bootstrap config completed successfully", args...)
|
||||
@@ -175,7 +175,7 @@ func (lm *loggingMiddleware) Bootstrap(ctx context.Context, externalKey, externa
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View bootstrap config failed to complete successfully", args...)
|
||||
lm.logger.Warn("View bootstrap config failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View bootstrap completed successfully", args...)
|
||||
@@ -193,7 +193,7 @@ func (lm *loggingMiddleware) ChangeState(ctx context.Context, token, id string,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Change thing state failed to complete successfully", args...)
|
||||
lm.logger.Warn("Change thing state failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Change thing state completed successfully", args...)
|
||||
@@ -214,7 +214,7 @@ func (lm *loggingMiddleware) UpdateChannelHandler(ctx context.Context, channel b
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update channel handler failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update channel handler failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update channel handler completed successfully", args...)
|
||||
@@ -231,7 +231,7 @@ func (lm *loggingMiddleware) RemoveConfigHandler(ctx context.Context, id string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Remove config handler failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove config handler failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove config handler completed successfully", args...)
|
||||
@@ -248,7 +248,7 @@ func (lm *loggingMiddleware) RemoveChannelHandler(ctx context.Context, id string
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Remove channel handler failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove channel handler failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove channel handler completed successfully", args...)
|
||||
@@ -266,7 +266,7 @@ func (lm *loggingMiddleware) ConnectThingHandler(ctx context.Context, channelID,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Connect thing handler failed to complete successfully", args...)
|
||||
lm.logger.Warn("Connect thing handler failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Connect thing handler completed successfully", args...)
|
||||
@@ -284,7 +284,7 @@ func (lm *loggingMiddleware) DisconnectThingHandler(ctx context.Context, channel
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Disconnect thing handler failed to complete successfully", args...)
|
||||
lm.logger.Warn("Disconnect thing handler failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Disconnect thing handler completed successfully", args...)
|
||||
|
||||
@@ -36,7 +36,7 @@ func (lm *loggingMiddleware) IssueCert(ctx context.Context, token, thingID, ttl
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Issue certificate failed to complete successfully", args...)
|
||||
lm.logger.Warn("Issue certificate failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Issue certificate completed successfully", args...)
|
||||
@@ -59,7 +59,7 @@ func (lm *loggingMiddleware) ListCerts(ctx context.Context, token, thingID strin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List certificates failed to complete successfully", args...)
|
||||
lm.logger.Warn("List certificates failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List certificates completed successfully", args...)
|
||||
@@ -83,7 +83,7 @@ func (lm *loggingMiddleware) ListSerials(ctx context.Context, token, thingID str
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List certifcates serials failed to complete successfully", args...)
|
||||
lm.logger.Warn("List certifcates serials failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List certificates serials completed successfully", args...)
|
||||
@@ -102,7 +102,7 @@ func (lm *loggingMiddleware) ViewCert(ctx context.Context, token, serialID strin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View certificate failed to complete successfully", args...)
|
||||
lm.logger.Warn("View certificate failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View certificate completed successfully", args...)
|
||||
@@ -121,7 +121,7 @@ func (lm *loggingMiddleware) RevokeCert(ctx context.Context, token, thingID stri
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Revoke certificate failed to complete successfully", args...)
|
||||
lm.logger.Warn("Revoke certificate failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Revoke certificate completed successfully", args...)
|
||||
|
||||
+3
-3
@@ -39,7 +39,7 @@ func (lm *loggingMiddleware) Publish(ctx context.Context, key string, msg *messa
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Publish message failed to complete successfully", args...)
|
||||
lm.logger.Warn("Publish message failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Publish message completed successfully", args...)
|
||||
@@ -61,7 +61,7 @@ func (lm *loggingMiddleware) Subscribe(ctx context.Context, key, chanID, subtopi
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Subscribe failed to complete successfully", args...)
|
||||
lm.logger.Warn("Subscribe failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Subscribe completed successfully", args...)
|
||||
@@ -83,7 +83,7 @@ func (lm *loggingMiddleware) Unsubscribe(ctx context.Context, key, chanID, subto
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Unsubscribe failed to complete successfully", args...)
|
||||
lm.logger.Warn("Unsubscribe failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Unsubscribe completed successfully", args...)
|
||||
|
||||
@@ -140,7 +140,7 @@ func handleGet(m *mux.Message, w mux.ResponseWriter, msg *messaging.Message, key
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
logger.Warn("Unsubscribe idle client failed to complete successfully ", args...)
|
||||
logger.Warn("Unsubscribe idle client failed ", args...)
|
||||
return
|
||||
}
|
||||
logger.Warn("Unsubscribe idle client completed successfully", args...)
|
||||
|
||||
@@ -38,7 +38,7 @@ func (lm *loggingMiddleware) CreateSubscription(ctx context.Context, token strin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Create subscription failed to complete successfully", args...)
|
||||
lm.logger.Warn("Create subscription failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Create subscription completed successfully", args...)
|
||||
@@ -60,7 +60,7 @@ func (lm *loggingMiddleware) ViewSubscription(ctx context.Context, token, topic
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View subscription failed to complete successfully", args...)
|
||||
lm.logger.Warn("View subscription failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View subscription completed successfully", args...)
|
||||
@@ -84,7 +84,7 @@ func (lm *loggingMiddleware) ListSubscriptions(ctx context.Context, token string
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List subscriptions failed to complete successfully", args...)
|
||||
lm.logger.Warn("List subscriptions failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List subscriptions completed successfully", args...)
|
||||
@@ -103,7 +103,7 @@ func (lm *loggingMiddleware) RemoveSubscription(ctx context.Context, token, id s
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Remove subscription failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove subscription failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove subscription completed successfully", args...)
|
||||
|
||||
@@ -36,7 +36,7 @@ func (lm *loggingMiddleware) CreateGroup(ctx context.Context, token, kind string
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Create group failed to complete successfully", args...)
|
||||
lm.logger.Warn("Create group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Create group completed successfully", args...)
|
||||
@@ -58,7 +58,7 @@ func (lm *loggingMiddleware) UpdateGroup(ctx context.Context, token string, grou
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update group failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update group completed successfully", args...)
|
||||
@@ -79,7 +79,7 @@ func (lm *loggingMiddleware) ViewGroup(ctx context.Context, token, id string) (g
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View group failed to complete successfully", args...)
|
||||
lm.logger.Warn("View group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View group completed successfully", args...)
|
||||
@@ -97,7 +97,7 @@ func (lm *loggingMiddleware) ViewGroupPerms(ctx context.Context, token, id strin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View group permissions failed to complete successfully", args...)
|
||||
lm.logger.Warn("View group permissions failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View group permissions completed successfully", args...)
|
||||
@@ -123,7 +123,7 @@ func (lm *loggingMiddleware) ListGroups(ctx context.Context, token, memberKind,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List groups failed to complete successfully", args...)
|
||||
lm.logger.Warn("List groups failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List groups completed successfully", args...)
|
||||
@@ -144,7 +144,7 @@ func (lm *loggingMiddleware) EnableGroup(ctx context.Context, token, id string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Enable group failed to complete successfully", args...)
|
||||
lm.logger.Warn("Enable group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Enable group completed successfully", args...)
|
||||
@@ -165,7 +165,7 @@ func (lm *loggingMiddleware) DisableGroup(ctx context.Context, token, id string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Disable group failed to complete successfully", args...)
|
||||
lm.logger.Warn("Disable group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Disable group completed successfully", args...)
|
||||
@@ -185,7 +185,7 @@ func (lm *loggingMiddleware) ListMembers(ctx context.Context, token, groupID, pe
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List members failed to complete successfully", args...)
|
||||
lm.logger.Warn("List members failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List members completed successfully", args...)
|
||||
@@ -204,7 +204,7 @@ func (lm *loggingMiddleware) Assign(ctx context.Context, token, groupID, relatio
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Assign member to group failed to complete successfully", args...)
|
||||
lm.logger.Warn("Assign member to group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Assign member to group completed successfully", args...)
|
||||
@@ -224,7 +224,7 @@ func (lm *loggingMiddleware) Unassign(ctx context.Context, token, groupID, relat
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Unassign member to group failed to complete successfully", args...)
|
||||
lm.logger.Warn("Unassign member to group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Unassign member to group completed successfully", args...)
|
||||
@@ -241,7 +241,7 @@ func (lm *loggingMiddleware) DeleteGroup(ctx context.Context, token, id string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Delete group failed to complete successfully", args...)
|
||||
lm.logger.Warn("Delete group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Delete group completed successfully", args...)
|
||||
|
||||
@@ -31,7 +31,7 @@ func (lm *logging) SendInvitation(ctx context.Context, token string, invitation
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Send invitation failed to complete successfully", args...)
|
||||
lm.logger.Warn("Send invitation failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Send invitation completed successfully", args...)
|
||||
@@ -48,7 +48,7 @@ func (lm *logging) ViewInvitation(ctx context.Context, token, userID, domainID s
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View invitation failed to complete successfully", args...)
|
||||
lm.logger.Warn("View invitation failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View invitation completed successfully", args...)
|
||||
@@ -68,7 +68,7 @@ func (lm *logging) ListInvitations(ctx context.Context, token string, page invit
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List invitations failed to complete successfully", args...)
|
||||
lm.logger.Warn("List invitations failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List invitations completed successfully", args...)
|
||||
@@ -84,7 +84,7 @@ func (lm *logging) AcceptInvitation(ctx context.Context, token, domainID string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Accept invitation failed to complete successfully", args...)
|
||||
lm.logger.Warn("Accept invitation failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Accept invitation completed successfully", args...)
|
||||
@@ -101,7 +101,7 @@ func (lm *logging) DeleteInvitation(ctx context.Context, token, userID, domainID
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Delete invitation failed to complete successfully", args...)
|
||||
lm.logger.Warn("Delete invitation failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Delete invitation completed successfully", args...)
|
||||
|
||||
+9
-9
@@ -37,7 +37,7 @@ func (lm loggingMiddleware) CreateThing(ctx context.Context, thingID, loraDevEUI
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Create thing route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Create thing route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Create thing route-map completed successfully", args...)
|
||||
@@ -55,7 +55,7 @@ func (lm loggingMiddleware) UpdateThing(ctx context.Context, thingID, loraDevEUI
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update thing route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update thing route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update thing route-map completed successfully", args...)
|
||||
@@ -72,7 +72,7 @@ func (lm loggingMiddleware) RemoveThing(ctx context.Context, thingID string) (er
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Remove thing route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove thing route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove thing route-map completed successfully", args...)
|
||||
@@ -90,7 +90,7 @@ func (lm loggingMiddleware) CreateChannel(ctx context.Context, chanID, loraApp s
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Create channel route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Create channel route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Create channel route-map completed successfully", args...)
|
||||
@@ -107,7 +107,7 @@ func (lm loggingMiddleware) UpdateChannel(ctx context.Context, chanID, loraApp s
|
||||
slog.String("lora_app", loraApp),
|
||||
}
|
||||
if err != nil {
|
||||
lm.logger.Warn("Update channel route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update channel route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update channel route-map completed successfully", args...)
|
||||
@@ -123,7 +123,7 @@ func (lm loggingMiddleware) RemoveChannel(ctx context.Context, chanID string) (e
|
||||
slog.String("channel_id", chanID),
|
||||
}
|
||||
if err != nil {
|
||||
lm.logger.Warn("Remove channel route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove channel route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove channel route-map completed successfully", args...)
|
||||
@@ -141,7 +141,7 @@ func (lm loggingMiddleware) ConnectThing(ctx context.Context, chanID, thingID st
|
||||
}
|
||||
if err != nil {
|
||||
args := append(args, slog.String("error", err.Error()))
|
||||
lm.logger.Warn("Connect thing to channel failed to complete successfully", args...)
|
||||
lm.logger.Warn("Connect thing to channel failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Connect thing to channel completed successfully", args...)
|
||||
@@ -159,7 +159,7 @@ func (lm loggingMiddleware) DisconnectThing(ctx context.Context, chanID, thingID
|
||||
}
|
||||
if err != nil {
|
||||
args := append(args, slog.String("error", err.Error()))
|
||||
lm.logger.Warn("Disconnect thing from channel failed to complete successfully", args...)
|
||||
lm.logger.Warn("Disconnect thing from channel failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Disconnect thing from channel completed successfully", args...)
|
||||
@@ -179,7 +179,7 @@ func (lm loggingMiddleware) Publish(ctx context.Context, msg *lora.Message) (err
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Publish failed to complete successfully", args...)
|
||||
lm.logger.Warn("Publish failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Publish completed successfully", args...)
|
||||
|
||||
@@ -37,7 +37,7 @@ func (lm loggingMiddleware) CreateThing(ctx context.Context, mgxThing, opcuaNode
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Create thing route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Create thing route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Create thing route-map completed successfully", args...)
|
||||
@@ -55,7 +55,7 @@ func (lm loggingMiddleware) UpdateThing(ctx context.Context, mgxThing, opcuaNode
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update thing route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update thing route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update thing route-map completed successfully", args...)
|
||||
@@ -72,7 +72,7 @@ func (lm loggingMiddleware) RemoveThing(ctx context.Context, mgxThing string) (e
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Remove thing route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove thing route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove thing route-map completed successfully", args...)
|
||||
@@ -90,7 +90,7 @@ func (lm loggingMiddleware) CreateChannel(ctx context.Context, mgxChan, opcuaSer
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Create channel route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Create channel route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Create channel route-map completed successfully", args...)
|
||||
@@ -108,7 +108,7 @@ func (lm loggingMiddleware) UpdateChannel(ctx context.Context, mgxChanID, opcuaS
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update channel route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update channel route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update channel route-map completed successfully", args...)
|
||||
@@ -125,7 +125,7 @@ func (lm loggingMiddleware) RemoveChannel(ctx context.Context, mgxChanID string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Remove channel route-map failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove channel route-map failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove channel route-map completed successfully", args...)
|
||||
@@ -143,7 +143,7 @@ func (lm loggingMiddleware) ConnectThing(ctx context.Context, mgxChanID string,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Connect thing to channel failed to complete successfully", args...)
|
||||
lm.logger.Warn("Connect thing to channel failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Connect thing to channel completed successfully", args...)
|
||||
@@ -161,7 +161,7 @@ func (lm loggingMiddleware) DisconnectThing(ctx context.Context, mgxChanID strin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Disconnect thing from channel failed to complete successfully", args...)
|
||||
lm.logger.Warn("Disconnect thing from channel failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Disconnect thing from channel completed successfully", args...)
|
||||
@@ -181,7 +181,7 @@ func (lm loggingMiddleware) Browse(ctx context.Context, serverURI, namespace, id
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Browse available nodes failed to complete successfully", args...)
|
||||
lm.logger.Warn("Browse available nodes failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Browse available nodes completed successfully", args...)
|
||||
|
||||
@@ -83,7 +83,7 @@ func (lm *loggingMiddleware) logAction(action string, topics *[]string, t time.T
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn(action+" failed to complete successfully", args...)
|
||||
lm.logger.Warn(action+" failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info(action+" completed successfully", args...)
|
||||
|
||||
@@ -33,7 +33,7 @@ func (lm *loggingMiddleware) Provision(token, name, externalID, externalKey stri
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Provision failed to complete successfully", args...)
|
||||
lm.logger.Warn("Provision failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Provision completed successfully", args...)
|
||||
@@ -67,7 +67,7 @@ func (lm *loggingMiddleware) Mapping(token string) (res map[string]interface{},
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Mapping failed to complete successfully", args...)
|
||||
lm.logger.Warn("Mapping failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Mapping completed successfully", args...)
|
||||
|
||||
@@ -46,7 +46,7 @@ func (lm *loggingMiddleware) ReadAll(chanID string, rpm readers.PageMetadata) (p
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Read all failed to complete successfully", args...)
|
||||
lm.logger.Warn("Read all failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Read all completed successfully", args...)
|
||||
|
||||
+15
-15
@@ -32,7 +32,7 @@ func (lm *loggingMiddleware) CreateThings(ctx context.Context, token string, cli
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn(fmt.Sprintf("Create %d things failed to complete successfully", len(clients)), args...)
|
||||
lm.logger.Warn(fmt.Sprintf("Create %d things failed", len(clients)), args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info(fmt.Sprintf("Create %d things completed successfully", len(clients)), args...)
|
||||
@@ -51,7 +51,7 @@ func (lm *loggingMiddleware) ViewClient(ctx context.Context, token, id string) (
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View thing failed to complete successfully", args...)
|
||||
lm.logger.Warn("View thing failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View thing completed successfully", args...)
|
||||
@@ -67,7 +67,7 @@ func (lm *loggingMiddleware) ViewClientPerms(ctx context.Context, token, id stri
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View thing permissions failed to complete successfully", args...)
|
||||
lm.logger.Warn("View thing permissions failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View thing permissions completed successfully", args...)
|
||||
@@ -88,7 +88,7 @@ func (lm *loggingMiddleware) ListClients(ctx context.Context, token, reqUserID s
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List things failed to complete successfully", args...)
|
||||
lm.logger.Warn("List things failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List things completed successfully", args...)
|
||||
@@ -108,7 +108,7 @@ func (lm *loggingMiddleware) UpdateClient(ctx context.Context, token string, cli
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update thing failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update thing failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update thing completed successfully", args...)
|
||||
@@ -128,7 +128,7 @@ func (lm *loggingMiddleware) UpdateClientTags(ctx context.Context, token string,
|
||||
}
|
||||
if err != nil {
|
||||
args := append(args, slog.String("error", err.Error()))
|
||||
lm.logger.Warn("Update thing tags failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update thing tags failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update thing tags completed successfully", args...)
|
||||
@@ -147,7 +147,7 @@ func (lm *loggingMiddleware) UpdateClientSecret(ctx context.Context, token, oldS
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update thing secret failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update thing secret failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update thing secret completed successfully", args...)
|
||||
@@ -166,7 +166,7 @@ func (lm *loggingMiddleware) EnableClient(ctx context.Context, token, id string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Enable thing failed to complete successfully", args...)
|
||||
lm.logger.Warn("Enable thing failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Enable thing completed successfully", args...)
|
||||
@@ -185,7 +185,7 @@ func (lm *loggingMiddleware) DisableClient(ctx context.Context, token, id string
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Disable thing failed to complete successfully", args...)
|
||||
lm.logger.Warn("Disable thing failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Disable thing completed successfully", args...)
|
||||
@@ -206,7 +206,7 @@ func (lm *loggingMiddleware) ListClientsByGroup(ctx context.Context, token, chan
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List things by group failed to complete successfully", args...)
|
||||
lm.logger.Warn("List things by group failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List things by group completed successfully", args...)
|
||||
@@ -222,7 +222,7 @@ func (lm *loggingMiddleware) Identify(ctx context.Context, key string) (id strin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Identify thing failed to complete successfully", args...)
|
||||
lm.logger.Warn("Identify thing failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Identify thing completed successfully", args...)
|
||||
@@ -241,7 +241,7 @@ func (lm *loggingMiddleware) Authorize(ctx context.Context, req *magistrala.Auth
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Authorize failed to complete successfully", args...)
|
||||
lm.logger.Warn("Authorize failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Authorize completed successfully", args...)
|
||||
@@ -259,7 +259,7 @@ func (lm *loggingMiddleware) Share(ctx context.Context, token, id, relation stri
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Share thing failed to complete successfully", args...)
|
||||
lm.logger.Warn("Share thing failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Share thing completed successfully", args...)
|
||||
@@ -277,7 +277,7 @@ func (lm *loggingMiddleware) Unshare(ctx context.Context, token, id, relation st
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Unshare thing failed to complete successfully", args...)
|
||||
lm.logger.Warn("Unshare thing failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Unshare thing completed successfully", args...)
|
||||
@@ -293,7 +293,7 @@ func (lm *loggingMiddleware) DeleteClient(ctx context.Context, token, id string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Delete thing failed to complete successfully", args...)
|
||||
lm.logger.Warn("Delete thing failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Delete thing completed successfully", args...)
|
||||
|
||||
@@ -38,7 +38,7 @@ func (lm *loggingMiddleware) AddTwin(ctx context.Context, token string, twin twi
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Add twin failed to complete successfully", args...)
|
||||
lm.logger.Warn("Add twin failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Add twin completed successfully", args...)
|
||||
@@ -59,7 +59,7 @@ func (lm *loggingMiddleware) UpdateTwin(ctx context.Context, token string, twin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update twin failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update twin failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update twin completed successfully", args...)
|
||||
@@ -76,7 +76,7 @@ func (lm *loggingMiddleware) ViewTwin(ctx context.Context, token, twinID string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View twin failed to complete successfully", args...)
|
||||
lm.logger.Warn("View twin failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View twin completed successfully", args...)
|
||||
@@ -98,7 +98,7 @@ func (lm *loggingMiddleware) ListTwins(ctx context.Context, token string, offset
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List twins failed to complete successfully", args...)
|
||||
lm.logger.Warn("List twins failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List twins completed successfully", args...)
|
||||
@@ -119,7 +119,7 @@ func (lm *loggingMiddleware) SaveStates(ctx context.Context, msg *messaging.Mess
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Save states failed to complete successfully", args...)
|
||||
lm.logger.Warn("Save states failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Save states completed successfully", args...)
|
||||
@@ -141,7 +141,7 @@ func (lm *loggingMiddleware) ListStates(ctx context.Context, token string, offse
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List states failed to complete successfully", args...)
|
||||
lm.logger.Warn("List states failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List states completed successfully", args...)
|
||||
@@ -158,7 +158,7 @@ func (lm *loggingMiddleware) RemoveTwin(ctx context.Context, token, twinID strin
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Remove twin failed to complete successfully", args...)
|
||||
lm.logger.Warn("Remove twin failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Remove twin completed successfully", args...)
|
||||
|
||||
+19
-19
@@ -38,7 +38,7 @@ func (lm *loggingMiddleware) RegisterClient(ctx context.Context, token string, c
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Register user failed to complete successfully", args...)
|
||||
lm.logger.Warn("Register user failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Register user completed successfully", args...)
|
||||
@@ -59,7 +59,7 @@ func (lm *loggingMiddleware) IssueToken(ctx context.Context, identity, secret, d
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Issue token failed to complete successfully", args...)
|
||||
lm.logger.Warn("Issue token failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Issue token completed successfully", args...)
|
||||
@@ -80,7 +80,7 @@ func (lm *loggingMiddleware) RefreshToken(ctx context.Context, refreshToken, dom
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Refresh token failed to complete successfully", args...)
|
||||
lm.logger.Warn("Refresh token failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Refresh token completed successfully", args...)
|
||||
@@ -101,7 +101,7 @@ func (lm *loggingMiddleware) ViewClient(ctx context.Context, token, id string) (
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View user failed to complete successfully", args...)
|
||||
lm.logger.Warn("View user failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View user completed successfully", args...)
|
||||
@@ -122,7 +122,7 @@ func (lm *loggingMiddleware) ViewProfile(ctx context.Context, token string) (c m
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("View profile failed to complete successfully", args...)
|
||||
lm.logger.Warn("View profile failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("View profile completed successfully", args...)
|
||||
@@ -144,7 +144,7 @@ func (lm *loggingMiddleware) ListClients(ctx context.Context, token string, pm m
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List users failed to complete successfully", args...)
|
||||
lm.logger.Warn("List users failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List users completed successfully", args...)
|
||||
@@ -166,7 +166,7 @@ func (lm *loggingMiddleware) UpdateClient(ctx context.Context, token string, cli
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update user failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update user failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update user completed successfully", args...)
|
||||
@@ -188,7 +188,7 @@ func (lm *loggingMiddleware) UpdateClientTags(ctx context.Context, token string,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update user tags failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update user tags failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update user tags completed successfully", args...)
|
||||
@@ -209,7 +209,7 @@ func (lm *loggingMiddleware) UpdateClientIdentity(ctx context.Context, token, id
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update client identity failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update client identity failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update client identity completed successfully", args...)
|
||||
@@ -230,7 +230,7 @@ func (lm *loggingMiddleware) UpdateClientSecret(ctx context.Context, token, oldS
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update user secret failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update user secret failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update user secret completed successfully", args...)
|
||||
@@ -248,7 +248,7 @@ func (lm *loggingMiddleware) GenerateResetToken(ctx context.Context, email, host
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Generate reset token failed to complete successfully", args...)
|
||||
lm.logger.Warn("Generate reset token failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Generate reset token completed successfully", args...)
|
||||
@@ -265,7 +265,7 @@ func (lm *loggingMiddleware) ResetSecret(ctx context.Context, token, secret stri
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Reset secret failed to complete successfully", args...)
|
||||
lm.logger.Warn("Reset secret failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Reset secret completed successfully", args...)
|
||||
@@ -283,7 +283,7 @@ func (lm *loggingMiddleware) SendPasswordReset(ctx context.Context, host, email,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Send password reset failed to complete successfully", args...)
|
||||
lm.logger.Warn("Send password reset failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Send password reset completed successfully", args...)
|
||||
@@ -305,7 +305,7 @@ func (lm *loggingMiddleware) UpdateClientRole(ctx context.Context, token string,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Update user role failed to complete successfully", args...)
|
||||
lm.logger.Warn("Update user role failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Update user role completed successfully", args...)
|
||||
@@ -326,7 +326,7 @@ func (lm *loggingMiddleware) EnableClient(ctx context.Context, token, id string)
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Enable user failed to complete successfully", args...)
|
||||
lm.logger.Warn("Enable user failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Enable user completed successfully", args...)
|
||||
@@ -347,7 +347,7 @@ func (lm *loggingMiddleware) DisableClient(ctx context.Context, token, id string
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Disable user failed to complete successfully", args...)
|
||||
lm.logger.Warn("Disable user failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Disable user completed successfully", args...)
|
||||
@@ -373,7 +373,7 @@ func (lm *loggingMiddleware) ListMembers(ctx context.Context, token, objectKind,
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("List members failed to complete successfully", args...)
|
||||
lm.logger.Warn("List members failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("List members completed successfully", args...)
|
||||
@@ -390,7 +390,7 @@ func (lm *loggingMiddleware) Identify(ctx context.Context, token string) (id str
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Identify user failed to complete successfully", args...)
|
||||
lm.logger.Warn("Identify user failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Identify user completed successfully", args...)
|
||||
@@ -406,7 +406,7 @@ func (lm *loggingMiddleware) OAuthCallback(ctx context.Context, client mgclients
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("OAuth callback failed to complete successfully", args...)
|
||||
lm.logger.Warn("OAuth callback failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("OAuth callback completed successfully", args...)
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ func (lm *loggingMiddleware) Subscribe(ctx context.Context, thingKey, chanID, su
|
||||
}
|
||||
if err != nil {
|
||||
args = append(args, slog.Any("error", err))
|
||||
lm.logger.Warn("Subscibe failed to complete successfully", args...)
|
||||
lm.logger.Warn("Subscibe failed", args...)
|
||||
return
|
||||
}
|
||||
lm.logger.Info("Subscribe completed successfully", args...)
|
||||
|
||||
Reference in New Issue
Block a user