Skip to content

Commit

Permalink
improve: change summary print from logging to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
lupinthe14th committed Jan 21, 2021
1 parent 5a724cd commit 4951dd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,13 @@ func searchAction(c *cli.Context) error {
took,
)
if c.Bool("print") {
printAmplitudeIDSummary(amplitudeIDs)
printAmplitudeIDSummary(c, amplitudeIDs)
}
return nil
}

func printAmplitudeIDSummary(amplitudeIDs []AmplitudeID) {
func printAmplitudeIDSummary(c *cli.Context, amplitudeIDs []AmplitudeID) {
w := c.App.Writer
memo := make(map[string]int)
for _, v := range amplitudeIDs {
memo[v.UserID]++
Expand All @@ -246,7 +247,7 @@ func printAmplitudeIDSummary(amplitudeIDs []AmplitudeID) {
return userIDs[i].count < userIDs[j].count
})
for i, userID := range userIDs {
log.Debug().Msgf("%v: %v: %v", i+1, userID.uuid, userID.count)
fmt.Fprintf(w, "%v: %v: %v\n", i+1, userID.uuid, userID.count)
}
}

Expand Down

0 comments on commit 4951dd8

Please sign in to comment.