@@ -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 .Error ( "Publish message failed to complete successfully" , args ... )
42+ lm .logger .ErrorContext ( ctx , "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 .Error ( "Subscribe failed to complete successfully" , args ... )
64+ lm .logger .ErrorContext ( ctx , "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 .Error ( "Unsubscribe failed to complete successfully" , args ... )
86+ lm .logger .ErrorContext ( ctx , "Unsubscribe failed to complete successfully" , args ... )
8787 return
8888 }
8989 lm .logger .Info ("Unsubscribe completed successfully" , args ... )
0 commit comments