Skip to content

Commit

Permalink
change over from fmt to log
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Plachter <matthew.plachter@zapier.com>
  • Loading branch information
mplachter committed Aug 16, 2023
1 parent 0b187ce commit baf1f78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"context"
"fmt"
"log"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -38,7 +39,7 @@ func resolveLogLevel() zerolog.Level {

lvl, err := zerolog.ParseLevel(logLevel)
if err != nil {
fmt.Println("could not parse log level, defaulting to 'info'")
log.Println("could not parse log level, defaulting to 'info'")
lvl = zerolog.InfoLevel
}
return lvl
Expand Down Expand Up @@ -68,9 +69,9 @@ func initTelemetry(ctx context.Context) (*telemetry.OperatorTelemetry, error) {
Version: pkg.GitTag,
CommitSHA: pkg.GitCommit,
}
fmt.Printf("enabled: %v\thost: %s\tport: %s\n", enableOtel, otelHost, otelPort)
log.Printf("enabled: %v\thost: %s\tport: %s\n", enableOtel, otelHost, otelPort)

fmt.Printf("OpenTelemetry Opts: %+v\n", opts)
log.Printf("OpenTelemetry Opts: %+v\n", opts)

return telemetry.Init(ctx, "tfbuddy", opts)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/tfc_utils/ci_job_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package tfc_utils

import (
"context"
"fmt"
"strings"

tfe "github.com/hashicorp/go-tfe"
Expand Down Expand Up @@ -149,5 +148,5 @@ func canCancelRun(run *tfe.Run) bool {
}

func printRunInfo(run *tfe.Run, title, wsName string) {
fmt.Printf(RunInfo, title, run.ID, run.Status, run.Source, run.Message, wsName, run.ID)
log.Printf(RunInfo, title, run.ID, run.Status, run.Source, run.Message, wsName, run.ID)
}
3 changes: 1 addition & 2 deletions pkg/vcs/github/hooks/github_hooks_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package hooks

import (
"context"
"fmt"
"os"

"github.com/cbrgm/githubevents/githubevents"
Expand Down Expand Up @@ -75,7 +74,7 @@ func NewGithubHooksHandler(vcs vcs.GitClient, tfc tfc_api.ApiClient, rs runstrea
func (h *GithubHooksHandler) Handler(c echo.Context) error {
err := h.ghEvents.HandleEventRequest(c.Request())
if err != nil {
fmt.Printf("error: %v\n", err)
log.Printf("error: %v\n", err)
}
return c.String(200, "NOK")
}
Expand Down

0 comments on commit baf1f78

Please sign in to comment.