diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-07 20:57:04 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-07 20:57:04 +0800 |
commit | 688d118c7e0d439691e84fc6e068ab3e19da5185 (patch) | |
tree | 6891a60950e0c2956c9f2d4fed6fceb67430775c /p2p/nat/nat.go | |
parent | 01b2c90179ff82e4610745aea0e3e3ca53756305 (diff) | |
download | dexon-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.gz dexon-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.zst dexon-688d118c7e0d439691e84fc6e068ab3e19da5185.zip |
Updated logging
Diffstat (limited to 'p2p/nat/nat.go')
-rw-r--r-- | p2p/nat/nat.go | 13 |
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) } |