Commit 6eb96993 authored by Matt Joiner's avatar Matt Joiner
Browse files

Revert "Upgrade to log v0.5.0"

This reverts commit 8dce0076.
parent 8dce0076
......@@ -31,7 +31,7 @@ func mainErr() int {
s, err := dht.NewServer(func() *dht.ServerConfig {
sc := dht.NewDefaultServerConfig()
if flags.Debug {
sc.Logger = log.Default()
sc.Logger = log.Default
}
return sc
}())
......
......@@ -103,14 +103,14 @@ func TestPing(t *testing.T) {
srv, err := NewServer(&ServerConfig{
Conn: recvConn,
NoSecurity: true,
Logger: log.Default(),
Logger: log.Default,
})
require.NoError(t, err)
defer srv.Close()
srv0, err := NewServer(&ServerConfig{
Conn: mustListen("127.0.0.1:5681"),
StartingNodes: addrResolver("127.0.0.1:5680"),
Logger: log.Default(),
Logger: log.Default,
})
require.NoError(t, err)
defer srv0.Close()
......@@ -279,7 +279,7 @@ func TestBootstrapRace(t *testing.T) {
Conn: &serverPc,
StartingNodes: addrResolver(remotePc.LocalAddr().String()),
QueryResendDelay: func() time.Duration { return 0 },
Logger: log.Default(),
Logger: log.Default,
})
require.NoError(t, err)
defer s.Close()
......
......@@ -2,7 +2,7 @@ module github.com/anacrolix/dht/v2
require (
github.com/anacrolix/envpprof v1.0.1
github.com/anacrolix/log v0.5.0
github.com/anacrolix/log v0.4.0
github.com/anacrolix/missinggo v1.2.1
github.com/anacrolix/missinggo/v2 v2.3.0
github.com/anacrolix/stm v0.1.1-0.20191106051447-e749ba3531cf
......
......@@ -158,7 +158,7 @@ func NewServer(c *ServerConfig) (s *Server, err error) {
// If Logger is empty, emulate the old behaviour: Everything is logged to the default location,
// and there are no debug messages.
if c.Logger.LoggerImpl == nil {
c.Logger = log.Default().WithFilter(func(m log.Msg) bool {
c.Logger = log.Default.WithFilter(func(m log.Msg) bool {
return !m.HasValue(log.Debug)
})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment