From 02461d0bb0d98e8ae5939158185d63207124d1fa Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Date: Wed, 14 May 2025 14:56:18 +0330 Subject: [PATCH] Improve logging format and clarity for post/account insertion stats --- cmd/main.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 1679236..492c745 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -34,18 +34,14 @@ func main() { var newAccounts = appContext.PostService.GetNewAccounts(existingAccountIds, newPosts) // Save to database - log.Printf("Number of existing posts: %d, existing accounts: %d, new posts: %d, new accounts: %d\n", len(existingPostIds), len(existingAccountIds), len(newPosts), len(newAccounts)) + log.Printf("Fetched %d posts, %d accounts; %d new posts and %d new accounts\n", len(posts), len(existingAccountIds), len(newPosts), len(newAccounts)) // Additional logging if newAccounts != nil { - log.Println("Number of inserted accounts: ", appContext.PostService.InsertNewAccounts(newAccounts)) - } else { - log.Print(" - No new accounts inserted") + log.Printf("Inserted %d accounts\n", appContext.PostService.InsertNewAccounts(newAccounts)) } if newPosts != nil { - log.Print(" - Number of inserted posts: ", appContext.PostService.InsertNewPosts(newPosts)) - } else { - log.Print(" - No new posts inserted") + log.Printf("Inserted %d posts\n", appContext.PostService.InsertNewPosts(newPosts)) } }