Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
521cd9ea
Unverified
Commit
521cd9ea
authored
Sep 02, 2018
by
Steven Allen
Committed by
GitHub
Sep 02, 2018
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
p2p/discovery/mdns.go
View file @
521cd9ea
...
@@ -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
...
...
package.json
View file @
521cd9ea
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
"version"
:
"0.0.0"
"version"
:
"0.0.0"
},
},
{
{
"hash"
:
"Qm
NeRzgrSpwbMU7VKLRyfvbqf1nRrAiQ7fEXaBxWGT5Ygr
"
,
"hash"
:
"Qm
ekaTKpWkYGcn4ZEC5PwJDRCQHapwugmmG86g2Xpz5GBH
"
,
"name"
:
"mdns"
,
"name"
:
"mdns"
,
"version"
:
"0.
1.3
"
"version"
:
"0.
2.0
"
},
},
{
{
"hash"
:
"QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A"
,
"hash"
:
"QmPdKqUcHGFdeSpvjVoaTRPPstGif9GBZb5Q56RVw9o69A"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment