to internal logger for levels, all encompassing path
This commit is contained in:
@@ -3,7 +3,7 @@ package broker
|
||||
import (
|
||||
"fmt"
|
||||
"local/truckstop/config"
|
||||
"log"
|
||||
"local/truckstop/logtr"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@@ -65,7 +65,7 @@ func (j Job) FormatMultilineText() string {
|
||||
out := ""
|
||||
clients := config.Clients(j.Pickup.Date)
|
||||
for k := range clients {
|
||||
log.Printf("job multiline: %+v contains %s then use %v", clients[k].States, j.Pickup.State, k)
|
||||
logtr.Debugf("job multiline: %+v contains %s then use %v", clients[k].States, j.Pickup.State, k)
|
||||
if strings.Contains(fmt.Sprint(clients[k].States), j.Pickup.State) {
|
||||
if len(out) > 0 {
|
||||
out += "\n"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"local/truckstop/config"
|
||||
"log"
|
||||
"local/truckstop/logtr"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
@@ -120,7 +120,7 @@ func (ntg NTGVision) searchJob(id int64) (io.ReadCloser, error) {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
b, _ := ioutil.ReadAll(resp.Body)
|
||||
log.Printf("fetch ntg job info %+v: %d: %s", request, resp.StatusCode, b)
|
||||
logtr.Debugf("fetch ntg job info %+v: %d: %s", request, resp.StatusCode, b)
|
||||
if resp.StatusCode > 400 && resp.StatusCode < 500 && resp.StatusCode != 404 && resp.StatusCode != 410 {
|
||||
return nil, ErrNoAuth
|
||||
}
|
||||
@@ -149,7 +149,7 @@ func (ntgJob *ntgVisionJob) Job() Job {
|
||||
secrets: func() interface{} {
|
||||
jobInfo, err := ntgJob.JobInfo()
|
||||
if err != nil {
|
||||
log.Printf("failed to get jobinfo: %v", err)
|
||||
logtr.Errorf("failed to get jobinfo: %v", err)
|
||||
return nil
|
||||
}
|
||||
return jobInfo.String()
|
||||
@@ -199,7 +199,7 @@ func (ntg NTGVision) Search(states []config.State) ([]Job, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Printf("ntg search for %+v: %s", states, b)
|
||||
logtr.Debugf("ntg search for %+v: %s", states, b)
|
||||
|
||||
var ntgjobs []ntgVisionJob
|
||||
err = json.Unmarshal(b, &ntgjobs)
|
||||
@@ -243,7 +243,7 @@ func (ntg NTGVision) search(states []config.State) (io.ReadCloser, error) {
|
||||
}
|
||||
|
||||
func (ntg NTGVision) refreshAuth() error {
|
||||
log.Printf("refreshing ntg auth...")
|
||||
logtr.Infof("refreshing ntg auth...")
|
||||
b, _ := json.Marshal(map[string]string{
|
||||
"username": config.Get().Brokers.NTG.Username,
|
||||
"password": config.Get().Brokers.NTG.Password,
|
||||
|
||||
Reference in New Issue
Block a user