mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-31 00:03:47 +00:00
types/logger, logpolicy: disable rate limiting, don't upload on Plan 9
To ease local debugging and have fewer moving pieces while bringing up Plan 9 support. Updates #5794 Change-Id: I2dc98e73bbb0d4d4730dc47203efc0550a0ac0a0 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
3da1728207
commit
da8e8eb86f
@ -627,7 +627,7 @@ func (opts Options) New() *Policy {
|
|||||||
conf.IncludeProcSequence = true
|
conf.IncludeProcSequence = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if envknob.NoLogsNoSupport() || testenv.InTest() {
|
if envknob.NoLogsNoSupport() || testenv.InTest() || runtime.GOOS == "plan9" {
|
||||||
opts.Logf("You have disabled logging. Tailscale will not be able to provide support.")
|
opts.Logf("You have disabled logging. Tailscale will not be able to provide support.")
|
||||||
conf.HTTPC = &http.Client{Transport: noopPretendSuccessTransport{}}
|
conf.HTTPC = &http.Client{Transport: noopPretendSuccessTransport{}}
|
||||||
} else {
|
} else {
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -162,6 +163,10 @@ func RateLimitedFnWithClock(logf Logf, f time.Duration, burst int, maxCache int,
|
|||||||
if envknob.String("TS_DEBUG_LOG_RATE") == "all" {
|
if envknob.String("TS_DEBUG_LOG_RATE") == "all" {
|
||||||
return logf
|
return logf
|
||||||
}
|
}
|
||||||
|
if runtime.GOOS == "plan9" {
|
||||||
|
// To ease bring-up.
|
||||||
|
return logf
|
||||||
|
}
|
||||||
var (
|
var (
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
msgLim = make(map[string]*limitData) // keyed by logf format
|
msgLim = make(map[string]*limitData) // keyed by logf format
|
||||||
|
Loading…
x
Reference in New Issue
Block a user