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)
|
var newAccounts = appContext.PostService.GetNewAccounts(existingAccountIds, newPosts)
|
||||||
|
|
||||||
// Save to database
|
// 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
|
// Additional logging
|
||||||
if newAccounts != nil {
|
if newAccounts != nil {
|
||||||
log.Println("Number of inserted accounts: ", appContext.PostService.InsertNewAccounts(newAccounts))
|
log.Printf("Inserted %d accounts\n", appContext.PostService.InsertNewAccounts(newAccounts))
|
||||||
} else {
|
|
||||||
log.Print(" - No new accounts inserted")
|
|
||||||
}
|
}
|
||||||
if newPosts != nil {
|
if newPosts != nil {
|
||||||
log.Print(" - Number of inserted posts: ", appContext.PostService.InsertNewPosts(newPosts))
|
log.Printf("Inserted %d posts\n", appContext.PostService.InsertNewPosts(newPosts))
|
||||||
} else {
|
|
||||||
log.Print(" - No new posts inserted")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user