Use logger.Logf consistently. It was used in most places.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-02-11 09:37:20 -08:00
parent c1917710ad
commit a59dc5f155
4 changed files with 13 additions and 8 deletions

View File

@@ -23,6 +23,7 @@ import (
"sync"
"tailscale.com/derp"
"tailscale.com/logger"
)
// Client is a DERP-over-HTTP client.
@@ -32,7 +33,7 @@ import (
// Send/Recv will completely re-establish the connection.
type Client struct {
privateKey [32]byte
logf func(format string, args ...interface{})
logf logger.Logf
closed chan struct{}
url *url.URL
resp *http.Response
@@ -44,13 +45,13 @@ type Client struct {
client *derp.Client
}
func NewClient(privateKey [32]byte, serverURL string, logf func(format string, args ...interface{})) (c *Client, err error) {
func NewClient(privateKey [32]byte, serverURL string, logf logger.Logf) (*Client, error) {
u, err := url.Parse(serverURL)
if err != nil {
return nil, fmt.Errorf("derphttp.NewClient: %v", err)
}
c = &Client{
c := &Client{
privateKey: privateKey,
logf: logf,
url: u,