Skip to content

Commit

Permalink
Reforctored errors in coap
Browse files Browse the repository at this point in the history
Signed-off-by: nyagamunene <[email protected]>
  • Loading branch information
nyagamunene committed Apr 23, 2024
1 parent 0419892 commit e908369
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coap/api/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.Error("Publish message failed to complete successfully", args...)
return
}
lm.logger.Info("Publish message completed successfully", args...)
Expand All @@ -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.Error("Subscribe failed to complete successfully", args...)
return
}
lm.logger.Info("Subscribe completed successfully", args...)
Expand All @@ -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.Error("Unsubscribe failed to complete successfully", args...)
return
}
lm.logger.Info("Unsubscribe completed successfully", args...)
Expand Down

0 comments on commit e908369

Please sign in to comment.