Unverified Commit 521cd9ea authored by Steven Allen's avatar Steven Allen Committed by GitHub
Browse files

Merge pull request #408 from libp2p/dont-disable-logging

use the new DisableLogging mdns option, don't turn off logging globally
parents 7dffae8a bb971794
...@@ -4,8 +4,6 @@ import ( ...@@ -4,8 +4,6 @@ import (
"context" "context"
"errors" "errors"
"io" "io"
"io/ioutil"
golog "log"
"net" "net"
"sync" "sync"
"time" "time"
...@@ -19,6 +17,11 @@ import ( ...@@ -19,6 +17,11 @@ import (
"github.com/whyrusleeping/mdns" "github.com/whyrusleeping/mdns"
) )
func init() {
// don't let mdns use logging...
mdns.DisableLogging = true
}
var log = logging.Logger("mdns") var log = logging.Logger("mdns")
const ServiceTag = "_ipfs-discovery._udp" const ServiceTag = "_ipfs-discovery._udp"
...@@ -64,9 +67,6 @@ func getDialableListenAddrs(ph host.Host) ([]*net.TCPAddr, error) { ...@@ -64,9 +67,6 @@ func getDialableListenAddrs(ph host.Host) ([]*net.TCPAddr, error) {
func NewMdnsService(ctx context.Context, peerhost host.Host, interval time.Duration, serviceTag string) (Service, error) { func NewMdnsService(ctx context.Context, peerhost host.Host, interval time.Duration, serviceTag string) (Service, error) {
// TODO: dont let mdns use logging...
golog.SetOutput(ioutil.Discard)
var ipaddrs []net.IP var ipaddrs []net.IP
port := 4001 port := 4001
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
"version": "0.0.0" "version": "0.0.0"
}, },
{ {
"hash": "QmNeRzgrSpwbMU7VKLRyfvbqf1nRrAiQ7fEXaBxWGT5Ygr", "hash": "QmekaTKpWkYGcn4ZEC5PwJDRCQHapwugmmG86g2Xpz5GBH",
"name": "mdns", "name": "mdns",
"version": "0.1.3" "version": "0.2.0"
}, },
{ {
"hash": "QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A", "hash": "QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A",
......
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