Skip to content

Commit

Permalink
Fix: don't pollute stdout with logs (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmarek authored May 28, 2021
1 parent 1e4beab commit 596a0b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions appSyncClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (client *appSyncClient) CreateOrUpdateResolvers(apiID string, resolversFile
FunctionVersion: aws.String("2018-05-29"),
})
if err != nil {
fmt.Printf("Function %s failed to update: %s", function.Name, err)
logger.Println(fmt.Sprintf("Function %s failed to update: %s", function.Name, err))
functionStatistics.FailedToUpdate++
} else {
functionStatistics.Updated++
Expand All @@ -159,7 +159,7 @@ func (client *appSyncClient) CreateOrUpdateResolvers(apiID string, resolversFile
})

if err != nil {
fmt.Printf("Function %s failed to create: %s", *function.Name, err)
logger.Println(fmt.Sprintf("Function %s failed to create: %s", *function.Name, err))
functionStatistics.FailedToCreate++
} else {
functions = append(functions, function)
Expand Down Expand Up @@ -224,7 +224,7 @@ func (client *appSyncClient) CreateOrUpdateResolvers(apiID string, resolversFile
}
_, err := client.updateResolver(params)
if err != nil {
fmt.Printf("Resolver on type %s and field %s failed to update: %s", resolver.TypeName, resolver.FieldName, err)
logger.Println(fmt.Sprintf("Resolver on type %s and field %s failed to update: %s", resolver.TypeName, resolver.FieldName, err))
resolverStatistics.FailedToUpdate++
} else {
resolverStatistics.Updated++
Expand All @@ -242,7 +242,7 @@ func (client *appSyncClient) CreateOrUpdateResolvers(apiID string, resolversFile
}
_, err := client.createResolver(params)
if err != nil {
fmt.Printf("Resolver on type %s and field %s failed to create: %s", resolver.TypeName, resolver.FieldName, err)
logger.Println(fmt.Sprintf("Resolver on type %s and field %s failed to create: %s", resolver.TypeName, resolver.FieldName, err))
resolverStatistics.FailedToCreate++
} else {
resolverStatistics.Created++
Expand Down

0 comments on commit 596a0b4

Please sign in to comment.