Skip to content

Commit 21cd402

Browse files
authored
logtail: do not log when backing off (tailscale#5485)
1 parent 0ae0439 commit 21cd402

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

logtail/logtail.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"net/http"
1818
"os"
1919
"strconv"
20+
"strings"
2021
"sync"
2122
"sync/atomic"
2223
"time"
@@ -108,6 +109,10 @@ func NewLogger(cfg Config, logf tslogger.Logf) *Logger {
108109
procID = 7
109110
}
110111
}
112+
113+
stdLogf := func(f string, a ...any) {
114+
fmt.Fprintf(cfg.Stderr, strings.TrimSuffix(f, "\n")+"\n", a...)
115+
}
111116
l := &Logger{
112117
privateID: cfg.PrivateID,
113118
stderr: cfg.Stderr,
@@ -121,7 +126,7 @@ func NewLogger(cfg Config, logf tslogger.Logf) *Logger {
121126
sentinel: make(chan int32, 16),
122127
drainLogs: cfg.DrainLogs,
123128
timeNow: cfg.TimeNow,
124-
bo: backoff.NewBackoff("logtail", logf, 30*time.Second),
129+
bo: backoff.NewBackoff("logtail", stdLogf, 30*time.Second),
125130
metricsDelta: cfg.MetricsDelta,
126131

127132
procID: procID,

0 commit comments

Comments
 (0)