Commit 983ed327 authored by Jeromy's avatar Jeromy
Browse files

extract logging



License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent 5d1b8295
......@@ -23,9 +23,10 @@ import (
pb "github.com/ipfs/go-ipfs/p2p/crypto/pb"
u "github.com/ipfs/go-ipfs/util"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
)
var log = u.Logger("crypto")
var log = logging.Logger("crypto")
var ErrBadKeyType = errors.New("invalid or unsupported key type")
......
......@@ -14,11 +14,11 @@ import (
ci "github.com/ipfs/go-ipfs/p2p/crypto"
pb "github.com/ipfs/go-ipfs/p2p/crypto/secio/pb"
peer "github.com/ipfs/go-ipfs/p2p/peer"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
u "github.com/ipfs/go-ipfs/util"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
)
var log = eventlog.Logger("secio")
var log = logging.Logger("secio")
// ErrUnsupportedKeyType is returned when a private key cast/type switch fails.
var ErrUnsupportedKeyType = errors.New("unsupported key type")
......
......@@ -15,10 +15,10 @@ import (
"github.com/ipfs/go-ipfs/p2p/host"
"github.com/ipfs/go-ipfs/p2p/peer"
u "github.com/ipfs/go-ipfs/util"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
)
var log = u.Logger("mdns")
var log = logging.Logger("mdns")
const ServiceTag = "discovery.ipfs.io"
......
......@@ -8,7 +8,7 @@ import (
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
metrics "github.com/ipfs/go-ipfs/metrics"
mstream "github.com/ipfs/go-ipfs/metrics/stream"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
inet "github.com/ipfs/go-ipfs/p2p/net"
peer "github.com/ipfs/go-ipfs/p2p/peer"
......@@ -17,7 +17,7 @@ import (
relay "github.com/ipfs/go-ipfs/p2p/protocol/relay"
)
var log = eventlog.Logger("p2p/host/basic")
var log = logging.Logger("p2p/host/basic")
// Option is a type used to pass in options to the host.
type Option int
......
......@@ -7,10 +7,10 @@ import (
inet "github.com/ipfs/go-ipfs/p2p/net"
peer "github.com/ipfs/go-ipfs/p2p/peer"
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
)
var log = eventlog.Logger("p2p/host")
var log = logging.Logger("p2p/host")
// Host is an object participating in a p2p network, which
// implements protocols or provides services. It handles
......
......@@ -6,7 +6,7 @@ import (
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
metrics "github.com/ipfs/go-ipfs/metrics"
......@@ -17,7 +17,7 @@ import (
routing "github.com/ipfs/go-ipfs/routing"
)
var log = eventlog.Logger("p2p/host/routed")
var log = logging.Logger("p2p/host/routed")
// AddressTTL is the expiry time for our addresses.
// We expire them quickly.
......
......@@ -14,8 +14,8 @@ import (
nat "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/fd/go-nat"
goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
periodic "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/periodic"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
notifier "github.com/ipfs/go-ipfs/thirdparty/notifier"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
)
var (
......@@ -23,7 +23,7 @@ var (
ErrNoMapping = errors.New("mapping not established")
)
var log = eventlog.Logger("nat")
var log = logging.Logger("nat")
// MappingDuration is a default port mapping duration.
// Port mappings are renewed every (MappingDuration / 3)
......
......@@ -13,12 +13,12 @@ import (
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
ic "github.com/ipfs/go-ipfs/p2p/crypto"
peer "github.com/ipfs/go-ipfs/p2p/peer"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
u "github.com/ipfs/go-ipfs/util"
lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
)
var log = eventlog.Logger("conn")
var log = logging.Logger("conn")
// ReleaseBuffer puts the given byte array back into the buffer pool,
// first verifying that it is the correct size
......
package mocknet
import (
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
)
var log = eventlog.Logger("mocknet")
var log = logging.Logger("mocknet")
// WithNPeers constructs a Mocknet with N peers.
func WithNPeers(ctx context.Context, n int) (Mocknet, error) {
......
......@@ -3,14 +3,14 @@ package addrutil
import (
"fmt"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
)
var log = eventlog.Logger("p2p/net/swarm/addr")
var log = logging.Logger("p2p/net/swarm/addr")
// SupportedTransportStrings is the list of supported transports for the swarm.
// These are strings of encapsulated multiaddr protocols. E.g.:
......@@ -176,12 +176,12 @@ func ResolveUnspecifiedAddresses(unspecAddrs, ifaceAddrs []ma.Multiaddr) ([]ma.M
return nil, fmt.Errorf("failed to specify addrs: %s", unspecAddrs)
}
log.Event(context.TODO(), "interfaceListenAddresses", func() eventlog.Loggable {
log.Event(context.TODO(), "interfaceListenAddresses", func() logging.Loggable {
var addrs []string
for _, addr := range outputAddrs {
addrs = append(addrs, addr.String())
}
return eventlog.Metadata{"addresses": addrs}
return logging.Metadata{"addresses": addrs}
}())
log.Debug("ResolveUnspecifiedAddresses:", unspecAddrs, ifaceAddrs, outputAddrs)
......
......@@ -12,7 +12,7 @@ import (
filter "github.com/ipfs/go-ipfs/p2p/net/filter"
addrutil "github.com/ipfs/go-ipfs/p2p/net/swarm/addr"
peer "github.com/ipfs/go-ipfs/p2p/peer"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
ps "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-peerstream"
......@@ -25,7 +25,7 @@ import (
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
)
var log = eventlog.Logger("swarm2")
var log = logging.Logger("swarm2")
var PSTransport pst.Transport
......
......@@ -13,9 +13,10 @@ import (
ic "github.com/ipfs/go-ipfs/p2p/crypto"
u "github.com/ipfs/go-ipfs/util"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
)
var log = u.Logger("peer")
var log = logging.Logger("peer")
// ID represents the identity of a peer.
type ID string
......
......@@ -3,10 +3,10 @@ package queue
import (
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
peer "github.com/ipfs/go-ipfs/p2p/peer"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
)
var log = eventlog.Logger("peerqueue")
var log = logging.Logger("peerqueue")
// ChanQueue makes any PeerQueue synchronizable through channels.
type ChanQueue struct {
......
......@@ -16,11 +16,11 @@ import (
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
pb "github.com/ipfs/go-ipfs/p2p/protocol/identify/pb"
config "github.com/ipfs/go-ipfs/repo/config"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
)
var log = eventlog.Logger("net/identify")
var log = logging.Logger("net/identify")
// ID is the protocol.ID of the Identify Service.
const ID protocol.ID = "/ipfs/identify"
......
......@@ -7,11 +7,11 @@ import (
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
inet "github.com/ipfs/go-ipfs/p2p/net"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
)
var log = eventlog.Logger("net/mux")
var log = logging.Logger("net/mux")
type streamHandlerMap map[ID]inet.StreamHandler
......
......@@ -11,11 +11,11 @@ import (
host "github.com/ipfs/go-ipfs/p2p/host"
inet "github.com/ipfs/go-ipfs/p2p/net"
peer "github.com/ipfs/go-ipfs/p2p/peer"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
u "github.com/ipfs/go-ipfs/util"
)
var log = eventlog.Logger("ping")
var log = logging.Logger("ping")
const PingSize = 32
......
......@@ -10,10 +10,10 @@ import (
inet "github.com/ipfs/go-ipfs/p2p/net"
peer "github.com/ipfs/go-ipfs/p2p/peer"
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
)
var log = eventlog.Logger("p2p/protocol/relay")
var log = logging.Logger("p2p/protocol/relay")
// ID is the protocol.ID of the Relay Service.
const ID protocol.ID = "/ipfs/relay"
......
......@@ -8,12 +8,12 @@ import (
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
relay "github.com/ipfs/go-ipfs/p2p/protocol/relay"
testutil "github.com/ipfs/go-ipfs/p2p/test/util"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
)
var log = eventlog.Logger("relay_test")
var log = logging.Logger("relay_test")
func TestRelaySimple(t *testing.T) {
......
......@@ -11,13 +11,13 @@ import (
peer "github.com/ipfs/go-ipfs/p2p/peer"
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
testutil "github.com/ipfs/go-ipfs/p2p/test/util"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
u "github.com/ipfs/go-ipfs/util"
)
var log = eventlog.Logger("backpressure")
var log = logging.Logger("backpressure")
// TestBackpressureStreamHandler tests whether mux handler
// ratelimiting works. Meaning, since the handler is sequential
......
......@@ -12,7 +12,7 @@ import (
swarm "github.com/ipfs/go-ipfs/p2p/net/swarm"
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
testutil "github.com/ipfs/go-ipfs/p2p/test/util"
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
u "github.com/ipfs/go-ipfs/util"
ps "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-peerstream"
......@@ -24,7 +24,7 @@ func init() {
ps.GarbageCollectTimeout = 10 * time.Millisecond
}
var log = eventlog.Logger("reconnect")
var log = logging.Logger("reconnect")
func EchoStreamHandler(stream inet.Stream) {
c := stream.Conn()
......
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