aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/nat
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-07 20:57:04 +0800
committerobscuren <geffobscura@gmail.com>2015-04-07 20:57:04 +0800
commit688d118c7e0d439691e84fc6e068ab3e19da5185 (patch)
tree6891a60950e0c2956c9f2d4fed6fceb67430775c /p2p/nat
parent01b2c90179ff82e4610745aea0e3e3ca53756305 (diff)
downloadgo-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.gz
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.bz2
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.lz
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.xz
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.zst
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.zip
Updated logging
Diffstat (limited to 'p2p/nat')
-rw-r--r--p2p/nat/nat.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go
index 12d355ba1..4ae7e6b17 100644
--- a/p2p/nat/nat.go
+++ b/p2p/nat/nat.go
@@ -10,11 +10,10 @@ import (
"time"
"github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/logger/glog"
"github.com/jackpal/go-nat-pmp"
)
-var log = logger.NewLogger("P2P NAT")
-
// An implementation of nat.Interface can map local ports to ports
// accessible from the Internet.
type Interface interface {
@@ -87,12 +86,12 @@ func Map(m Interface, c chan struct{}, protocol string, extport, intport int, na
refresh := time.NewTimer(mapUpdateInterval)
defer func() {
refresh.Stop()
- log.Debugf("Deleting port mapping: %s %d -> %d (%s) using %s\n", protocol, extport, intport, name, m)
+ glog.V(logger.Debug).Infof("Deleting port mapping: %s %d -> %d (%s) using %s\n", protocol, extport, intport, name, m)
m.DeleteMapping(protocol, extport, intport)
}()
- log.Debugf("add mapping: %s %d -> %d (%s) using %s\n", protocol, extport, intport, name, m)
+ glog.V(logger.Debug).Infof("add mapping: %s %d -> %d (%s) using %s\n", protocol, extport, intport, name, m)
if err := m.AddMapping(protocol, intport, extport, name, mapTimeout); err != nil {
- log.Errorf("mapping error: %v\n", err)
+ glog.V(logger.Error).Infof("mapping error: %v\n", err)
}
for {
select {
@@ -101,9 +100,9 @@ func Map(m Interface, c chan struct{}, protocol string, extport, intport int, na
return
}
case <-refresh.C:
- log.DebugDetailf("refresh mapping: %s %d -> %d (%s) using %s\n", protocol, extport, intport, name, m)
+ glog.V(logger.Detail).Infof("refresh mapping: %s %d -> %d (%s) using %s\n", protocol, extport, intport, name, m)
if err := m.AddMapping(protocol, intport, extport, name, mapTimeout); err != nil {
- log.Errorf("mapping error: %v\n", err)
+ glog.V(logger.Error).Infof("mapping error: %v\n", err)
}
refresh.Reset(mapUpdateInterval)
}