Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Commit 3fac5f7

Browse files
committed
Adjust log output
1 parent a8cf965 commit 3fac5f7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

config/cloudinit/pkg/http_client.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ import (
1818
"errors"
1919
"fmt"
2020
"io/ioutil"
21-
"log"
2221
"net/http"
2322
neturl "net/url"
2423
"strings"
2524
"time"
25+
26+
"github.com/rancher/os/pkg/log"
2627
)
2728

2829
const (
@@ -120,22 +121,22 @@ func (h *HTTPClient) GetRetry(rawurl string) ([]byte, error) {
120121

121122
duration := h.InitialBackoff
122123
for retry := 1; retry <= h.MaxRetries; retry++ {
123-
log.Printf("Fetching data from %s. Attempt #%d", dataURL, retry)
124+
log.Debugf("Fetching data from %s. Attempt #%d", dataURL, retry)
124125

125126
data, err := h.Get(dataURL)
126127
switch err.(type) {
127128
case ErrNetwork:
128-
log.Printf(err.Error())
129+
log.Debugf(err.Error())
129130
case ErrServer:
130-
log.Printf(err.Error())
131+
log.Debugf(err.Error())
131132
case ErrNotFound:
132133
return data, err
133134
default:
134135
return data, err
135136
}
136137

137138
duration = ExpBackoff(duration, h.MaxBackoff)
138-
log.Printf("Sleeping for %v...", duration)
139+
log.Debugf("Sleeping for %v...", duration)
139140
time.Sleep(duration)
140141
}
141142

0 commit comments

Comments
 (0)