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