Skip to content

Commit e908369

Browse files
committed
Reforctored errors in coap
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
1 parent 0419892 commit e908369

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

coap/api/logging.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (lm *loggingMiddleware) Publish(ctx context.Context, key string, msg *messa
3939
}
4040
if err != nil {
4141
args = append(args, slog.Any("error", err))
42-
lm.logger.Warn("Publish message failed to complete successfully", args...)
42+
lm.logger.Error("Publish message failed to complete successfully", args...)
4343
return
4444
}
4545
lm.logger.Info("Publish message completed successfully", args...)
@@ -61,7 +61,7 @@ func (lm *loggingMiddleware) Subscribe(ctx context.Context, key, chanID, subtopi
6161
}
6262
if err != nil {
6363
args = append(args, slog.Any("error", err))
64-
lm.logger.Warn("Subscribe failed to complete successfully", args...)
64+
lm.logger.Error("Subscribe failed to complete successfully", args...)
6565
return
6666
}
6767
lm.logger.Info("Subscribe completed successfully", args...)
@@ -83,7 +83,7 @@ func (lm *loggingMiddleware) Unsubscribe(ctx context.Context, key, chanID, subto
8383
}
8484
if err != nil {
8585
args = append(args, slog.Any("error", err))
86-
lm.logger.Warn("Unsubscribe failed to complete successfully", args...)
86+
lm.logger.Error("Unsubscribe failed to complete successfully", args...)
8787
return
8888
}
8989
lm.logger.Info("Unsubscribe completed successfully", args...)

0 commit comments

Comments
 (0)