Skip to content

Commit

Permalink
Merge pull request #8 from flanksource/improve-logging
Browse files Browse the repository at this point in the history
fix: print pipeline ID
  • Loading branch information
BrendanGalloway authored Jun 30, 2022
2 parents 6474686 + dce37e1 commit d577c72
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package pkg
import (
"errors"
"fmt"
"log"
"strings"

"github.com/google/martian/log"
"github.com/xanzy/go-gitlab"
)

Expand Down Expand Up @@ -35,7 +35,6 @@ func (g *GitLabProject) SetBranch(name string) error {
if err != nil {
return err
}
log.Infof("Found %s/%s: %s\n", g.Name, branch.Name, branch.Commit.ID)

g.branch.Name = branch.Name
g.branch.Ref = branch.Commit.ID
Expand Down Expand Up @@ -87,7 +86,7 @@ func (g *GitLabProject) TriggerPipeline(variables map[string]string) error {
return err
}
g.SetPipeline(pipeline)
log.Infof("Starting pipeline ID %d in project %s: %s\n", pipeline.ID, g.Name, pipeline.WebURL)
log.Println(fmt.Sprintf("Started pipeline ID %d in project %s: %s\n", pipeline.ID, g.Name, pipeline.WebURL))

return nil
}
Expand All @@ -100,7 +99,6 @@ func (g *GitLabProject) GetPipeLineStatus() (string, error) {
if err != nil {
return "", err
}
log.Infof("Pipeline %s/%d status: %s", g.Name, g.pipeline.ID, status.Status)
return status.Status, nil
}

Expand Down

0 comments on commit d577c72

Please sign in to comment.