Logger converts the Tailscale logging function to use a slog-compatible logger.
(logger interface {
Debug(ctx context.Context, str string, fields ...slog.Field)
},
)
| 1010 | // Logger converts the Tailscale logging function to use a slog-compatible |
| 1011 | // logger. |
| 1012 | func Logger(logger interface { |
| 1013 | Debug(ctx context.Context, str string, fields ...slog.Field) |
| 1014 | }, |
| 1015 | ) tslogger.Logf { |
| 1016 | return tslogger.Logf(func(format string, args ...any) { |
| 1017 | slog.Helper() |
| 1018 | logger.Debug(context.Background(), fmt.Sprintf(format, args...)) |
| 1019 | }) |
| 1020 | } |