Documentation
¶
Overview ¶
Package wglog contains logging helpers for wireguard-go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
A Logger is a wireguard-go log wrapper that cleans up and rewrites log lines. It rewrites wireguard-go peer references like "peer(XXXX…YYYY)" into the Tailscale-conventional short string form like "[XXXXX]".
func NewLogger ¶
NewLogger creates a new logger for use with wireguard-go. This logger silences repetitive/unhelpful noisy log lines and rewrites peer keys from wireguard-go into Tailscale format.
lookup, if non-nil, is consulted on cache misses to translate wireguard-go peer references in log lines. If lookup is nil, peer references are passed through unchanged.
func (*Logger) Invalidate ¶ added in v1.102.0
func (x *Logger) Invalidate()
Invalidate clears the peer-string rewrite cache.
Callers should invoke Invalidate when the set of wireguard-go peers has changed so that the next log line re-resolves peer references against the current lookup. It is safe to call concurrently with logging.