mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-27 11:41:14 +00:00
tsnet: expose logtail's Logf method (#17057)
This commit adds a new method to the tsnet.Server type named `Logger` that returns the underlying logtail instance's Logf method. This is intended to be used within the Kubernetes operator to wrap its existing logger in a way such that operator specific logs can also be sent to control for support & debugging purposes. Updates https://github.com/tailscale/corp/issues/32037 Signed-off-by: David Bond <davidsbond93@gmail.com>
This commit is contained in:
@@ -492,6 +492,16 @@ func (s *Server) TailscaleIPs() (ip4, ip6 netip.Addr) {
|
||||
return ip4, ip6
|
||||
}
|
||||
|
||||
// Logtailf returns a [logger.Logf] that outputs to Tailscale's logging service and will be only visible to Tailscale's
|
||||
// support team. Logs written there cannot be retrieved by the user. This method always returns a non-nil value.
|
||||
func (s *Server) Logtailf() logger.Logf {
|
||||
if s.logtail == nil {
|
||||
return logger.Discard
|
||||
}
|
||||
|
||||
return s.logtail.Logf
|
||||
}
|
||||
|
||||
func (s *Server) getAuthKey() string {
|
||||
if v := s.AuthKey; v != "" {
|
||||
return v
|
||||
|
||||
Reference in New Issue
Block a user