mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 03:31:39 +00:00
logtail: do not log when backing off (#5485)
This commit is contained in:
parent
0ae0439668
commit
21cd402204
@ -17,6 +17,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
@ -108,6 +109,10 @@ func NewLogger(cfg Config, logf tslogger.Logf) *Logger {
|
|||||||
procID = 7
|
procID = 7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stdLogf := func(f string, a ...any) {
|
||||||
|
fmt.Fprintf(cfg.Stderr, strings.TrimSuffix(f, "\n")+"\n", a...)
|
||||||
|
}
|
||||||
l := &Logger{
|
l := &Logger{
|
||||||
privateID: cfg.PrivateID,
|
privateID: cfg.PrivateID,
|
||||||
stderr: cfg.Stderr,
|
stderr: cfg.Stderr,
|
||||||
@ -121,7 +126,7 @@ func NewLogger(cfg Config, logf tslogger.Logf) *Logger {
|
|||||||
sentinel: make(chan int32, 16),
|
sentinel: make(chan int32, 16),
|
||||||
drainLogs: cfg.DrainLogs,
|
drainLogs: cfg.DrainLogs,
|
||||||
timeNow: cfg.TimeNow,
|
timeNow: cfg.TimeNow,
|
||||||
bo: backoff.NewBackoff("logtail", logf, 30*time.Second),
|
bo: backoff.NewBackoff("logtail", stdLogf, 30*time.Second),
|
||||||
metricsDelta: cfg.MetricsDelta,
|
metricsDelta: cfg.MetricsDelta,
|
||||||
|
|
||||||
procID: procID,
|
procID: procID,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user