From 1143e1301184ed0167f95e0fb78532bee0e0147e Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Mon, 1 Mar 2021 15:23:19 +0000 Subject: [PATCH] log sentiment analysis --- sentiment/subscriber/subscriber.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sentiment/subscriber/subscriber.go b/sentiment/subscriber/subscriber.go index c64fd11..8b52fdb 100644 --- a/sentiment/subscriber/subscriber.go +++ b/sentiment/subscriber/subscriber.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + "github.com/micro/micro/v3/service/logger" pb "github.com/micro/services/posts/proto" "github.com/micro/services/sentiment/model" ) @@ -25,6 +26,8 @@ func EnrichPost(ctx context.Context, post *pb.Post) error { score := model.Analyze(post.Title) post.Metadata["sentiment"] = fmt.Sprintf("%.1f", score) + logger.Info("Setting score %.1f for post %v", score, post.Title) + // now save the post PostsClient.Save(ctx, &pb.SaveRequest{ Id: post.Id,