Improve logging format and clarity for post/account insertion stats
This commit is contained in:
10
cmd/main.go
10
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))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user