Skip to content

Commit

Permalink
mattermost-communityGH-30 use api logwarn instead of std log
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorgabucio committed Oct 9, 2020
1 parent 2bd6e1b commit a99e504
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions server/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -89,7 +88,7 @@ func (p *Plugin) handleJobCreation(w http.ResponseWriter, r *http.Request) {
jobInputs[k] = v.(string)
}
if err := p.sendJobCreateRequest(userID, request.ChannelId, jobInputs); err != nil {
log.Println("Error sending job creation request", err)
p.API.LogWarn("Error sending job creation request", "err", err)
}
}

Expand Down
5 changes: 2 additions & 3 deletions server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"path/filepath"
Expand Down Expand Up @@ -74,7 +73,7 @@ func (p *Plugin) OnActivate() error {
}

if cmdErr := p.API.RegisterCommand(getCommand()); cmdErr != nil {
log.Println("Error registering Jenkins custom command", cmdErr)
p.API.LogWarn("Error registering Jenkins custom command", "err", cmdErr)
}

p.router = p.InitAPI()
Expand Down Expand Up @@ -321,7 +320,7 @@ func (p *Plugin) checkIfJobHasStarted(jenkins *gojenkins.Jenkins, jobName string
}
time.Sleep(pollingSleepTime * time.Second)
if _, err := task.Poll(); err != nil {
log.Println("Error polling jenkins job to check the build status", err)
p.API.LogWarn("Error polling jenkins job to check the build status", "err", err)
}
}
buildInfo, buildErr := jenkins.GetBuild(jobName, task.Raw.Executable.Number)
Expand Down

0 comments on commit a99e504

Please sign in to comment.