Skip to content

Commit

Permalink
chore: use log instead of logs
Browse files Browse the repository at this point in the history
  • Loading branch information
spoukke committed Feb 9, 2023
1 parent f575420 commit 7c788ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ func (w *Webhook) GetHttpHandler() func(http.ResponseWriter, *http.Request) {
func (w *Webhook) Handle(payload interface{}) {
webUrls, revision, change, touchedHead, changedFiles := affectedRevisionInfo(payload)
if len(webUrls) == 0 {
fmt.Println("Ignoring webhook event")
log.Println("Ignoring webhook event")
return
}
for _, webURL := range webUrls {
fmt.Printf("Received push event repo: %s, revision: %s, touchedHead: %v", webURL, revision, touchedHead)
log.Printf("Received push event repo: %s, revision: %s, touchedHead: %v", webURL, revision, touchedHead)
}
// The next 2 lines probably dont work, waiting for chat GPT to be up \o/
repositories := &configv1alpha1.TerraformRepositoryList{}
err := w.Client.List(context.TODO(), repositories)
if err != nil {
fmt.Println("could not get repositories")
log.Println("could not get repositories")
}

for _, url := range webUrls {
Expand All @@ -127,7 +127,7 @@ func (w *Webhook) Handle(payload interface{}) {
layers := &configv1alpha1.TerraformLayerList{}
err := w.Client.List(context.TODO(), layers, &client.ListOptions{})
if err != nil {
fmt.Println("could not get layers")
log.Println("could not get layers")
}
for _, layer := range layers.Items {
if layerFilesHaveChanged(&layer, changedFiles) {
Expand Down

0 comments on commit 7c788ac

Please sign in to comment.