mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-28 05:00:08 +00:00
feature/logtail: pull logtail + netlog out to modular features
Removes 434 KB from the minimal Linux binary, or ~3%. Primarily this comes from not linking in the zstd encoding code. Fixes #17323 Change-Id: I0a90de307dfa1ad7422db7aa8b1b46c782bfaaf7 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
e466488a2a
commit
11b770fbc9
@@ -31,6 +31,7 @@ import (
|
||||
"golang.org/x/term"
|
||||
"tailscale.com/atomicfile"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/health"
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/log/filelogger"
|
||||
@@ -106,6 +107,7 @@ type Policy struct {
|
||||
// Logtail is the logger.
|
||||
Logtail *logtail.Logger
|
||||
// PublicID is the logger's instance identifier.
|
||||
// It may be the zero value if logging is not in use.
|
||||
PublicID logid.PublicID
|
||||
// Logf is where to write informational messages about this Logger.
|
||||
Logf logger.Logf
|
||||
@@ -682,7 +684,7 @@ func (opts Options) init(disableLogging bool) (*logtail.Config, *Policy) {
|
||||
|
||||
// New returns a new log policy (a logger and its instance ID).
|
||||
func (opts Options) New() *Policy {
|
||||
disableLogging := envknob.NoLogsNoSupport() || testenv.InTest() || runtime.GOOS == "plan9"
|
||||
disableLogging := envknob.NoLogsNoSupport() || testenv.InTest() || runtime.GOOS == "plan9" || !buildfeatures.HasLogTail
|
||||
_, policy := opts.init(disableLogging)
|
||||
return policy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user