mirror of https://github.com/tailscale/tailscale/
types/logger: add adapters for Logf to std Logger/Writer
parent
5562fae9f0
commit
946df89fa6
@ -0,0 +1,21 @@
|
||||
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package logger
|
||||
|
||||
import (
|
||||
"log"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestFuncWriter(t *testing.T) {
|
||||
w := FuncWriter(t.Logf)
|
||||
lg := log.New(w, "prefix: ", 0)
|
||||
lg.Printf("plumbed through")
|
||||
}
|
||||
|
||||
func TestStdLogger(t *testing.T) {
|
||||
lg := StdLogger(t.Logf)
|
||||
lg.Printf("plumbed through")
|
||||
}
|
Loading…
Reference in New Issue