7 "github.com/anacrolix/log"
8 pp "github.com/anacrolix/torrent/peer_protocol"
11 func TestingConfig(t testing.TB) *ClientConfig {
12 cfg := NewDefaultClientConfig()
13 cfg.ListenHost = LoopbackListenHost
15 cfg.DataDir = t.TempDir()
16 cfg.DisableTrackers = true
17 cfg.NoDefaultPortForwarding = true
18 cfg.DisableAcceptRateLimiting = true
20 cfg.KeepAliveTimeout = time.Millisecond
21 cfg.MinPeerExtensions.SetBit(pp.ExtensionBitFast, true)
22 cfg.Logger = log.Default.WithNames(t.Name())
24 //cfg.Logger = cfg.Logger.WithText(func(m log.Msg) string {
26 // m.Values(func(i interface{}) bool {
27 // t += fmt.Sprintf("\n%[1]T: %[1]v", i)