@cryptotaxi247 / kubo / commits / e5a2896c0

extract logging

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Sep 14, 2015 at 17:33 UTC e5a2896c0eb64d3aad9bacec3f49c58f37a6b15b
90 files changed +209 -201
blocks/blockstore/blockstore.go
+2 -2
@@ -12,10 +12,10 @@ import (
12 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
13 blocks "github.com/ipfs/go-ipfs/blocks"
14 key "github.com/ipfs/go-ipfs/blocks/key"
15 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
15 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
16 )
17
18 -var log = eventlog.Logger("blockstore")
18 +var log = logging.Logger("blockstore")
19
20 // BlockPrefix namespaces blockstore datastores
21 var BlockPrefix = ds.NewKey("blocks")
blocks/set/set.go
+2 -2
@@ -4,10 +4,10 @@ package set
4 import (
5 "github.com/ipfs/go-ipfs/blocks/bloom"
6 key "github.com/ipfs/go-ipfs/blocks/key"
7 - "github.com/ipfs/go-ipfs/util"
7 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
8 )
9
10 -var log = util.Logger("blockset")
10 +var log = logging.Logger("blockset")
11
12 // BlockSet represents a mutable set of keyed blocks
13 type BlockSet interface {
blockservice/blockservice.go
+2 -2
@@ -12,7 +12,7 @@ import (
12 key "github.com/ipfs/go-ipfs/blocks/key"
13 worker "github.com/ipfs/go-ipfs/blockservice/worker"
14 exchange "github.com/ipfs/go-ipfs/exchange"
15 - u "github.com/ipfs/go-ipfs/util"
15 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
16 )
17
18 var wc = worker.Config{
@@ -32,7 +32,7 @@ var wc = worker.Config{
32 WorkerBufferSize: 0,
33 }
34
35 -var log = u.Logger("blockservice")
35 +var log = logging.Logger("blockservice")
36 var ErrNotFound = errors.New("blockservice: key not found")
37
38 // BlockService is a hybrid block datastore. It stores data in a local
blockservice/worker/worker.go
+3 -2
@@ -12,10 +12,11 @@ import (
12 blocks "github.com/ipfs/go-ipfs/blocks"
13 key "github.com/ipfs/go-ipfs/blocks/key"
14 exchange "github.com/ipfs/go-ipfs/exchange"
15 - util "github.com/ipfs/go-ipfs/util"
15 +
16 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
17 )
18
18 -var log = util.Logger("blockservice")
19 +var log = logging.Logger("blockservice")
20
21 var DefaultConfig = Config{
22 NumWorkers: 1,
cmd/ipfs/main.go
+4 -4
@@ -27,12 +27,12 @@ import (
27 repo "github.com/ipfs/go-ipfs/repo"
28 config "github.com/ipfs/go-ipfs/repo/config"
29 fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
30 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
30 u "github.com/ipfs/go-ipfs/util"
31 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
32 )
33
34 // log is the command logger
35 -var log = eventlog.Logger("cmd/ipfs")
35 +var log = logging.Logger("cmd/ipfs")
36
37 var (
38 errUnexpectedApiOutput = errors.New("api returned unexpected output")
@@ -62,7 +62,7 @@ type cmdInvocation struct {
62 func main() {
63 rand.Seed(time.Now().UnixNano())
64 runtime.GOMAXPROCS(3) // FIXME rm arbitrary choice for n
65 - ctx := eventlog.ContextWithLoggable(context.Background(), eventlog.Uuid("session"))
65 + ctx := logging.ContextWithLoggable(context.Background(), logging.Uuid("session"))
66 var err error
67 var invoc cmdInvocation
68 defer invoc.close()
@@ -175,7 +175,7 @@ func (i *cmdInvocation) Run(ctx context.Context) (output io.Reader, err error) {
175 }
176 if debug || u.GetenvBool("DEBUG") || os.Getenv("IPFS_LOGGING") == "debug" {
177 u.Debug = true
178 - u.SetDebugLogging()
178 + logging.SetDebugLogging()
179 }
180
181 res, err := callCommand(ctx, i.req, Root, i.cmd)
cmd/seccat/seccat.go
+2 -2
@@ -21,7 +21,7 @@ import (
21 ci "github.com/ipfs/go-ipfs/p2p/crypto"
22 secio "github.com/ipfs/go-ipfs/p2p/crypto/secio"
23 peer "github.com/ipfs/go-ipfs/p2p/peer"
24 - u "github.com/ipfs/go-ipfs/util"
24 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
25 )
26
27 var verbose = false
@@ -93,7 +93,7 @@ func main() {
93 args := parseArgs()
94 verbose = args.verbose
95 if args.debug {
96 - u.SetDebugLogging()
96 + logging.SetDebugLogging()
97 }
98
99 go func() {
cmd/seccat/util.go
+2 -2
@@ -5,10 +5,10 @@ import (
5 "io"
6 "os"
7
8 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
8 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
9 )
10
11 -var log = eventlog.Logger("seccat")
11 +var log = logging.Logger("seccat")
12
13 func exit(format string, vals ...interface{}) {
14 if format != "" {
commands/command.go
+2 -2
@@ -15,10 +15,10 @@ import (
15 "reflect"
16 "strings"
17
18 - u "github.com/ipfs/go-ipfs/util"
18 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
19 )
20
21 -var log = u.Logger("command")
21 +var log = logging.Logger("command")
22
23 // Function is the type of function that Commands use.
24 // It reads from the Request, and writes results to the Response.
commands/http/handler.go
+2 -2
@@ -16,10 +16,10 @@ import (
16 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
17
18 cmds "github.com/ipfs/go-ipfs/commands"
19 - u "github.com/ipfs/go-ipfs/util"
19 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
20 )
21
22 -var log = u.Logger("commands/http")
22 +var log = logging.Logger("commands/http")
23
24 // the internal handler for the API
25 type internalHandler struct {
core/commands/log.go
+3 -4
@@ -5,8 +5,7 @@ import (
5 "io"
6
7 cmds "github.com/ipfs/go-ipfs/commands"
8 - "github.com/ipfs/go-ipfs/thirdparty/eventlog"
9 - u "github.com/ipfs/go-ipfs/util"
8 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
9 )
10
11 // Golang os.Args overrides * and replaces the character argument with
@@ -54,7 +53,7 @@ output of a running daemon.
53 subsystem = "*"
54 }
55
57 - if err := u.SetLogLevel(subsystem, level); err != nil {
56 + if err := logging.SetLogLevel(subsystem, level); err != nil {
57 res.SetError(err, cmds.ErrNormal)
58 return
59 }
@@ -79,7 +78,7 @@ var logTailCmd = &cmds.Command{
78
79 Run: func(req cmds.Request, res cmds.Response) {
80 r, w := io.Pipe()
82 - eventlog.WriterGroup.AddWriter(w)
81 + logging.WriterGroup.AddWriter(w)
82 go func() {
83 <-req.Context().Done()
84 w.Close()
core/commands/root.go
+2 -2
@@ -6,10 +6,10 @@ import (
6
7 cmds "github.com/ipfs/go-ipfs/commands"
8 unixfs "github.com/ipfs/go-ipfs/core/commands/unixfs"
9 - evlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
9 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
10 )
11
12 -var log = evlog.Logger("core/commands")
12 +var log = logging.Logger("core/commands")
13
14 type TestOutput struct {
15 Foo string
core/core.go
+2 -2
@@ -33,7 +33,7 @@ import (
33 addrutil "github.com/ipfs/go-ipfs/p2p/net/swarm/addr"
34 peer "github.com/ipfs/go-ipfs/p2p/peer"
35 ping "github.com/ipfs/go-ipfs/p2p/protocol/ping"
36 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
36 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
37
38 routing "github.com/ipfs/go-ipfs/routing"
39 dht "github.com/ipfs/go-ipfs/routing/dht"
@@ -62,7 +62,7 @@ const kSizeBlockstoreWriteCache = 100
62 const kReprovideFrequency = time.Hour * 12
63 const discoveryConnTimeout = time.Second * 30
64
65 -var log = eventlog.Logger("core")
65 +var log = logging.Logger("core")
66
67 type mode int
68
core/corehttp/corehttp.go
+2 -2
@@ -14,10 +14,10 @@ import (
14 manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
15 "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
16 core "github.com/ipfs/go-ipfs/core"
17 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
17 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
18 )
19
20 -var log = eventlog.Logger("core/server")
20 +var log = logging.Logger("core/server")
21
22 // ServeOption registers any HTTP handlers it provides on the given mux.
23 // It returns the mux to expose to future options, which may be a new mux if it
core/corehttp/logs.go
+2 -2
@@ -6,7 +6,7 @@ import (
6 "net/http"
7
8 core "github.com/ipfs/go-ipfs/core"
9 - "github.com/ipfs/go-ipfs/thirdparty/eventlog"
9 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
10 )
11
12 type writeErrNotifier struct {
@@ -41,7 +41,7 @@ func LogOption() ServeOption {
41 mux.HandleFunc("/logs", func(w http.ResponseWriter, r *http.Request) {
42 w.WriteHeader(200)
43 wnf, errs := newWriteErrNotifier(w)
44 - eventlog.WriterGroup.AddWriter(wnf)
44 + logging.WriterGroup.AddWriter(wnf)
45 log.Event(n.Context(), "log API client connected")
46 <-errs
47 })
core/corerepo/gc.go
+2 -2
@@ -5,10 +5,10 @@ import (
5 key "github.com/ipfs/go-ipfs/blocks/key"
6 "github.com/ipfs/go-ipfs/core"
7
8 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
8 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
9 )
10
11 -var log = eventlog.Logger("corerepo")
11 +var log = logging.Logger("corerepo")
12
13 type KeyRemoved struct {
14 Key key.Key
core/coreunix/add.go
+2 -2
@@ -14,11 +14,11 @@ import (
14 chunk "github.com/ipfs/go-ipfs/importer/chunk"
15 merkledag "github.com/ipfs/go-ipfs/merkledag"
16 "github.com/ipfs/go-ipfs/pin"
17 - "github.com/ipfs/go-ipfs/thirdparty/eventlog"
17 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
18 unixfs "github.com/ipfs/go-ipfs/unixfs"
19 )
20
21 -var log = eventlog.Logger("coreunix")
21 +var log = logging.Logger("coreunix")
22
23 // Add builds a merkledag from the a reader, pinning all objects to the local
24 // datastore. Returns a key representing the root node.
diagnostics/diag.go
+2 -2
@@ -20,10 +20,10 @@ import (
20 inet "github.com/ipfs/go-ipfs/p2p/net"
21 peer "github.com/ipfs/go-ipfs/p2p/peer"
22 protocol "github.com/ipfs/go-ipfs/p2p/protocol"
23 - util "github.com/ipfs/go-ipfs/util"
23 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
24 )
25
26 -var log = util.Logger("diagnostics")
26 +var log = logging.Logger("diagnostics")
27
28 // ProtocolDiag is the diagnostics protocol.ID
29 var ProtocolDiag protocol.ID = "/ipfs/diagnostics"
exchange/bitswap/bitswap.go
+3 -3
@@ -22,10 +22,10 @@ import (
22 wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
23 peer "github.com/ipfs/go-ipfs/p2p/peer"
24 "github.com/ipfs/go-ipfs/thirdparty/delay"
25 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
25 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
26 )
27
28 -var log = eventlog.Logger("bitswap")
28 +var log = logging.Logger("bitswap")
29
30 const (
31 // maxProvidersPerRequest specifies the maximum number of providers desired
@@ -151,7 +151,7 @@ func (bs *Bitswap) GetBlock(parent context.Context, k key.Key) (*blocks.Block, e
151
152 ctx, cancelFunc := context.WithCancel(parent)
153
154 - ctx = eventlog.ContextWithLoggable(ctx, eventlog.Uuid("GetBlockRequest"))
154 + ctx = logging.ContextWithLoggable(ctx, logging.Uuid("GetBlockRequest"))
155 log.Event(ctx, "Bitswap.GetBlockRequest.Start", &k)
156 defer log.Event(ctx, "Bitswap.GetBlockRequest.End", &k)
157
exchange/bitswap/decision/engine.go
+2 -2
@@ -10,7 +10,7 @@ import (
10 bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message"
11 wl "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
12 peer "github.com/ipfs/go-ipfs/p2p/peer"
13 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
13 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
14 )
15
16 // TODO consider taking responsibility for other types of requests. For
@@ -43,7 +43,7 @@ import (
43 // whatever it sees fit to produce desired outcomes (get wanted keys
44 // quickly, maintain good relationships with peers, etc).
45
46 -var log = eventlog.Logger("engine")
46 +var log = logging.Logger("engine")
47
48 const (
49 // outboxChanBuffer must be 0 to prevent stale messages from being sent
exchange/bitswap/network/ipfs_impl.go
+2 -2
@@ -9,10 +9,10 @@ import (
9 inet "github.com/ipfs/go-ipfs/p2p/net"
10 peer "github.com/ipfs/go-ipfs/p2p/peer"
11 routing "github.com/ipfs/go-ipfs/routing"
12 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
12 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
13 )
14
15 -var log = eventlog.Logger("bitswap_network")
15 +var log = logging.Logger("bitswap_network")
16
17 // NewFromIpfsHost returns a BitSwapNetwork supported by underlying IPFS host
18 func NewFromIpfsHost(host host.Host, r routing.IpfsRouting) BitSwapNetwork {
exchange/bitswap/workers.go
+6 -6
@@ -9,7 +9,7 @@ import (
9 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
10
11 key "github.com/ipfs/go-ipfs/blocks/key"
12 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
12 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
13 )
14
15 var TaskWorkerCount = 8
@@ -45,7 +45,7 @@ func (bs *Bitswap) startWorkers(px process.Process, ctx context.Context) {
45 }
46
47 func (bs *Bitswap) taskWorker(ctx context.Context, id int) {
48 - idmap := eventlog.LoggableMap{"ID": id}
48 + idmap := logging.LoggableMap{"ID": id}
49 defer log.Info("bitswap task worker shutting down...")
50 for {
51 log.Event(ctx, "Bitswap.TaskWorker.Loop", idmap)
@@ -56,7 +56,7 @@ func (bs *Bitswap) taskWorker(ctx context.Context, id int) {
56 if !ok {
57 continue
58 }
59 - log.Event(ctx, "Bitswap.TaskWorker.Work", eventlog.LoggableMap{
59 + log.Event(ctx, "Bitswap.TaskWorker.Work", logging.LoggableMap{
60 "ID": id,
61 "Target": envelope.Peer.Pretty(),
62 "Block": envelope.Block.Multihash.B58String(),
@@ -77,7 +77,7 @@ func (bs *Bitswap) provideWorker(px process.Process) {
77 limiter := ratelimit.NewRateLimiter(px, provideWorkerMax)
78
79 limitedGoProvide := func(k key.Key, wid int) {
80 - ev := eventlog.LoggableMap{"ID": wid}
80 + ev := logging.LoggableMap{"ID": wid}
81 limiter.LimitedGo(func(px process.Process) {
82
83 ctx := procctx.OnClosingContext(px) // derive ctx from px
@@ -96,7 +96,7 @@ func (bs *Bitswap) provideWorker(px process.Process) {
96 // _ratelimited_ number of workers to handle each key.
97 limiter.Go(func(px process.Process) {
98 for wid := 2; ; wid++ {
99 - ev := eventlog.LoggableMap{"ID": 1}
99 + ev := logging.LoggableMap{"ID": 1}
100 log.Event(procctx.OnClosingContext(px), "Bitswap.ProvideWorker.Loop", ev)
101
102 select {
@@ -158,7 +158,7 @@ func (bs *Bitswap) providerConnector(parent context.Context) {
158 log.Warning("Received batch request for zero blocks")
159 continue
160 }
161 - log.Event(parent, "Bitswap.ProviderConnector.Work", eventlog.LoggableMap{"Keys": keys})
161 + log.Event(parent, "Bitswap.ProviderConnector.Work", logging.LoggableMap{"Keys": keys})
162
163 // NB: Optimization. Assumes that providers of key[0] are likely to
164 // be able to provide for all keys. This currently holds true in most
exchange/reprovide/reprovide.go
+2 -2
@@ -8,10 +8,10 @@ import (
8 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
9 blocks "github.com/ipfs/go-ipfs/blocks/blockstore"
10 routing "github.com/ipfs/go-ipfs/routing"
11 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
11 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
12 )
13
14 -var log = eventlog.Logger("reprovider")
14 +var log = logging.Logger("reprovider")
15
16 type Reprovider struct {
17 // The routing system to provide values through
fuse/ipns/ipns_unix.go
+2 -2
@@ -13,7 +13,7 @@ import (
13 fuse "github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse"
14 fs "github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs"
15 "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
16 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
16 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
17
18 key "github.com/ipfs/go-ipfs/blocks/key"
19 core "github.com/ipfs/go-ipfs/core"
@@ -23,7 +23,7 @@ import (
23 ft "github.com/ipfs/go-ipfs/unixfs"
24 )
25
26 -var log = eventlog.Logger("fuse/ipns")
26 +var log = logging.Logger("fuse/ipns")
27
28 // FileSystem is the readwrite IPNS Fuse Filesystem.
29 type FileSystem struct {
fuse/mount/mount.go
+2 -2
@@ -10,10 +10,10 @@ import (
10
11 goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
12
13 - u "github.com/ipfs/go-ipfs/util"
13 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
14 )
15
16 -var log = u.Logger("mount")
16 +var log = logging.Logger("mount")
17
18 var MountTimeout = time.Second * 5
19
fuse/readonly/readonly_unix.go
+2 -2
@@ -16,13 +16,13 @@ import (
16 core "github.com/ipfs/go-ipfs/core"
17 mdag "github.com/ipfs/go-ipfs/merkledag"
18 path "github.com/ipfs/go-ipfs/path"
19 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
19 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
20 uio "github.com/ipfs/go-ipfs/unixfs/io"
21 ftpb "github.com/ipfs/go-ipfs/unixfs/pb"
22 lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
23 )
24
25 -var log = eventlog.Logger("fuse/ipfs")
25 +var log = logging.Logger("fuse/ipfs")
26
27 // FileSystem is the readonly Ipfs Fuse Filesystem.
28 type FileSystem struct {
importer/chunk/splitting.go
+2 -2
@@ -4,10 +4,10 @@ package chunk
4 import (
5 "io"
6
7 - "github.com/ipfs/go-ipfs/util"
7 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
8 )
9
10 -var log = util.Logger("chunk")
10 +var log = logging.Logger("chunk")
11
12 var DefaultBlockSize int64 = 1024 * 256
13
importer/importer.go
+2 -2
@@ -13,10 +13,10 @@ import (
13 trickle "github.com/ipfs/go-ipfs/importer/trickle"
14 dag "github.com/ipfs/go-ipfs/merkledag"
15 "github.com/ipfs/go-ipfs/pin"
16 - u "github.com/ipfs/go-ipfs/util"
16 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
17 )
18
19 -var log = u.Logger("importer")
19 +var log = logging.Logger("importer")
20
21 // Builds a DAG from the given file, writing created blocks to disk as they are
22 // created
ipnsfs/system.go
+3 -3
@@ -25,10 +25,10 @@ import (
25 ft "github.com/ipfs/go-ipfs/unixfs"
26
27 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
28 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
28 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
29 )
30
31 -var log = eventlog.Logger("ipnsfs")
31 +var log = logging.Logger("ipnsfs")
32
33 var ErrIsDirectory = errors.New("error: is a directory")
34
@@ -236,7 +236,7 @@ func (kr *KeyRoot) Publish(ctx context.Context) error {
236
237 kp := path.FromKey(k)
238
239 - ev := &eventlog.Metadata{"name": kr.name, "key": kp}
239 + ev := &logging.Metadata{"name": kr.name, "key": kp}
240 defer log.EventBegin(ctx, "ipnsfsPublishing", ev).Done()
241 log.Info("ipnsfs publishing %s -> %s", kr.name, kp)
242
merkledag/merkledag.go
+2 -2
@@ -9,10 +9,10 @@ import (
9 blocks "github.com/ipfs/go-ipfs/blocks"
10 key "github.com/ipfs/go-ipfs/blocks/key"
11 bserv "github.com/ipfs/go-ipfs/blockservice"
12 - u "github.com/ipfs/go-ipfs/util"
12 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
13 )
14
15 -var log = u.Logger("merkledag")
15 +var log = logging.Logger("merkledag")
16 var ErrNotFound = fmt.Errorf("merkledag: not found")
17
18 // DAGService is an IPFS Merkle DAG service.
namesys/routing.go
+2 -2
@@ -11,10 +11,10 @@ import (
11 pb "github.com/ipfs/go-ipfs/namesys/pb"
12 path "github.com/ipfs/go-ipfs/path"
13 routing "github.com/ipfs/go-ipfs/routing"
14 - u "github.com/ipfs/go-ipfs/util"
14 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
15 )
16
17 -var log = u.Logger("namesys")
17 +var log = logging.Logger("namesys")
18
19 // routingResolver implements NSResolver for the main IPFS SFS-like naming
20 type routingResolver struct {
p2p/crypto/key.go
+2 -1
@@ -23,9 +23,10 @@ import (
23
24 pb "github.com/ipfs/go-ipfs/p2p/crypto/pb"
25 u "github.com/ipfs/go-ipfs/util"
26 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
27 )
28
28 -var log = u.Logger("crypto")
29 +var log = logging.Logger("crypto")
30
31 var ErrBadKeyType = errors.New("invalid or unsupported key type")
32
p2p/crypto/secio/protocol.go
+2 -2
@@ -14,11 +14,11 @@ import (
14 ci "github.com/ipfs/go-ipfs/p2p/crypto"
15 pb "github.com/ipfs/go-ipfs/p2p/crypto/secio/pb"
16 peer "github.com/ipfs/go-ipfs/p2p/peer"
17 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
17 u "github.com/ipfs/go-ipfs/util"
18 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
19 )
20
21 -var log = eventlog.Logger("secio")
21 +var log = logging.Logger("secio")
22
23 // ErrUnsupportedKeyType is returned when a private key cast/type switch fails.
24 var ErrUnsupportedKeyType = errors.New("unsupported key type")
p2p/discovery/mdns.go
+2 -2
@@ -15,10 +15,10 @@ import (
15
16 "github.com/ipfs/go-ipfs/p2p/host"
17 "github.com/ipfs/go-ipfs/p2p/peer"
18 - u "github.com/ipfs/go-ipfs/util"
18 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
19 )
20
21 -var log = u.Logger("mdns")
21 +var log = logging.Logger("mdns")
22
23 const ServiceTag = "discovery.ipfs.io"
24
p2p/host/basic/basic_host.go
+2 -2
@@ -8,7 +8,7 @@ import (
8 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
9 metrics "github.com/ipfs/go-ipfs/metrics"
10 mstream "github.com/ipfs/go-ipfs/metrics/stream"
11 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
11 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
12
13 inet "github.com/ipfs/go-ipfs/p2p/net"
14 peer "github.com/ipfs/go-ipfs/p2p/peer"
@@ -17,7 +17,7 @@ import (
17 relay "github.com/ipfs/go-ipfs/p2p/protocol/relay"
18 )
19
20 -var log = eventlog.Logger("p2p/host/basic")
20 +var log = logging.Logger("p2p/host/basic")
21
22 // Option is a type used to pass in options to the host.
23 type Option int
p2p/host/host.go
+2 -2
@@ -7,10 +7,10 @@ import (
7 inet "github.com/ipfs/go-ipfs/p2p/net"
8 peer "github.com/ipfs/go-ipfs/p2p/peer"
9 protocol "github.com/ipfs/go-ipfs/p2p/protocol"
10 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
10 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
11 )
12
13 -var log = eventlog.Logger("p2p/host")
13 +var log = logging.Logger("p2p/host")
14
15 // Host is an object participating in a p2p network, which
16 // implements protocols or provides services. It handles
p2p/host/routed/routed.go
+2 -2
@@ -6,7 +6,7 @@ import (
6
7 ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
8 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
9 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
9 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
10 lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
11
12 metrics "github.com/ipfs/go-ipfs/metrics"
@@ -17,7 +17,7 @@ import (
17 routing "github.com/ipfs/go-ipfs/routing"
18 )
19
20 -var log = eventlog.Logger("p2p/host/routed")
20 +var log = logging.Logger("p2p/host/routed")
21
22 // AddressTTL is the expiry time for our addresses.
23 // We expire them quickly.
p2p/nat/nat.go
+2 -2
@@ -14,8 +14,8 @@ import (
14 nat "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/fd/go-nat"
15 goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
16 periodic "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/periodic"
17 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
17 notifier "github.com/ipfs/go-ipfs/thirdparty/notifier"
18 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
19 )
20
21 var (
@@ -23,7 +23,7 @@ var (
23 ErrNoMapping = errors.New("mapping not established")
24 )
25
26 -var log = eventlog.Logger("nat")
26 +var log = logging.Logger("nat")
27
28 // MappingDuration is a default port mapping duration.
29 // Port mappings are renewed every (MappingDuration / 3)
p2p/net/conn/conn.go
+2 -2
@@ -13,12 +13,12 @@ import (
13 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
14 ic "github.com/ipfs/go-ipfs/p2p/crypto"
15 peer "github.com/ipfs/go-ipfs/p2p/peer"
16 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
16 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
17 u "github.com/ipfs/go-ipfs/util"
18 lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
19 )
20
21 -var log = eventlog.Logger("conn")
21 +var log = logging.Logger("conn")
22
23 // ReleaseBuffer puts the given byte array back into the buffer pool,
24 // first verifying that it is the correct size
p2p/net/mock/mock.go
+2 -2
@@ -1,12 +1,12 @@
1 package mocknet
2
3 import (
4 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
4 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
5
6 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
7 )
8
9 -var log = eventlog.Logger("mocknet")
9 +var log = logging.Logger("mocknet")
10
11 // WithNPeers constructs a Mocknet with N peers.
12 func WithNPeers(ctx context.Context, n int) (Mocknet, error) {
p2p/net/swarm/addr/addr.go
+4 -4
@@ -3,14 +3,14 @@ package addrutil
3 import (
4 "fmt"
5
6 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
6 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
7
8 ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
9 manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
10 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
11 )
12
13 -var log = eventlog.Logger("p2p/net/swarm/addr")
13 +var log = logging.Logger("p2p/net/swarm/addr")
14
15 // SupportedTransportStrings is the list of supported transports for the swarm.
16 // These are strings of encapsulated multiaddr protocols. E.g.:
@@ -176,12 +176,12 @@ func ResolveUnspecifiedAddresses(unspecAddrs, ifaceAddrs []ma.Multiaddr) ([]ma.M
176 return nil, fmt.Errorf("failed to specify addrs: %s", unspecAddrs)
177 }
178
179 - log.Event(context.TODO(), "interfaceListenAddresses", func() eventlog.Loggable {
179 + log.Event(context.TODO(), "interfaceListenAddresses", func() logging.Loggable {
180 var addrs []string
181 for _, addr := range outputAddrs {
182 addrs = append(addrs, addr.String())
183 }
184 - return eventlog.Metadata{"addresses": addrs}
184 + return logging.Metadata{"addresses": addrs}
185 }())
186
187 log.Debug("ResolveUnspecifiedAddresses:", unspecAddrs, ifaceAddrs, outputAddrs)
p2p/net/swarm/swarm.go
+2 -2
@@ -12,7 +12,7 @@ import (
12 filter "github.com/ipfs/go-ipfs/p2p/net/filter"
13 addrutil "github.com/ipfs/go-ipfs/p2p/net/swarm/addr"
14 peer "github.com/ipfs/go-ipfs/p2p/peer"
15 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
15 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
16
17 ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
18 ps "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-peerstream"
@@ -25,7 +25,7 @@ import (
25 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
26 )
27
28 -var log = eventlog.Logger("swarm2")
28 +var log = logging.Logger("swarm2")
29
30 var PSTransport pst.Transport
31
p2p/peer/peer.go
+2 -1
@@ -13,9 +13,10 @@ import (
13
14 ic "github.com/ipfs/go-ipfs/p2p/crypto"
15 u "github.com/ipfs/go-ipfs/util"
16 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
17 )
18
18 -var log = u.Logger("peer")
19 +var log = logging.Logger("peer")
20
21 // ID represents the identity of a peer.
22 type ID string
p2p/peer/queue/sync.go
+2 -2
@@ -3,10 +3,10 @@ package queue
3 import (
4 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
5 peer "github.com/ipfs/go-ipfs/p2p/peer"
6 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
6 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
7 )
8
9 -var log = eventlog.Logger("peerqueue")
9 +var log = logging.Logger("peerqueue")
10
11 // ChanQueue makes any PeerQueue synchronizable through channels.
12 type ChanQueue struct {
p2p/protocol/identify/id.go
+2 -2
@@ -16,11 +16,11 @@ import (
16 protocol "github.com/ipfs/go-ipfs/p2p/protocol"
17 pb "github.com/ipfs/go-ipfs/p2p/protocol/identify/pb"
18 config "github.com/ipfs/go-ipfs/repo/config"
19 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
19 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
20 lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
21 )
22
23 -var log = eventlog.Logger("net/identify")
23 +var log = logging.Logger("net/identify")
24
25 // ID is the protocol.ID of the Identify Service.
26 const ID protocol.ID = "/ipfs/identify"
p2p/protocol/mux.go
+2 -2
@@ -7,11 +7,11 @@ import (
7
8 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
9 inet "github.com/ipfs/go-ipfs/p2p/net"
10 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
10 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
11 lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
12 )
13
14 -var log = eventlog.Logger("net/mux")
14 +var log = logging.Logger("net/mux")
15
16 type streamHandlerMap map[ID]inet.StreamHandler
17
p2p/protocol/ping/ping.go
+2 -2
@@ -11,11 +11,11 @@ import (
11 host "github.com/ipfs/go-ipfs/p2p/host"
12 inet "github.com/ipfs/go-ipfs/p2p/net"
13 peer "github.com/ipfs/go-ipfs/p2p/peer"
14 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
14 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
15 u "github.com/ipfs/go-ipfs/util"
16 )
17
18 -var log = eventlog.Logger("ping")
18 +var log = logging.Logger("ping")
19
20 const PingSize = 32
21
p2p/protocol/relay/relay.go
+2 -2
@@ -10,10 +10,10 @@ import (
10 inet "github.com/ipfs/go-ipfs/p2p/net"
11 peer "github.com/ipfs/go-ipfs/p2p/peer"
12 protocol "github.com/ipfs/go-ipfs/p2p/protocol"
13 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
13 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
14 )
15
16 -var log = eventlog.Logger("p2p/protocol/relay")
16 +var log = logging.Logger("p2p/protocol/relay")
17
18 // ID is the protocol.ID of the Relay Service.
19 const ID protocol.ID = "/ipfs/relay"
p2p/protocol/relay/relay_test.go
+2 -2
@@ -8,12 +8,12 @@ import (
8 protocol "github.com/ipfs/go-ipfs/p2p/protocol"
9 relay "github.com/ipfs/go-ipfs/p2p/protocol/relay"
10 testutil "github.com/ipfs/go-ipfs/p2p/test/util"
11 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
11 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
12
13 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
14 )
15
16 -var log = eventlog.Logger("relay_test")
16 +var log = logging.Logger("relay_test")
17
18 func TestRelaySimple(t *testing.T) {
19
p2p/test/backpressure/backpressure_test.go
+2 -2
@@ -11,13 +11,13 @@ import (
11 peer "github.com/ipfs/go-ipfs/p2p/peer"
12 protocol "github.com/ipfs/go-ipfs/p2p/protocol"
13 testutil "github.com/ipfs/go-ipfs/p2p/test/util"
14 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
14 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
15
16 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
17 u "github.com/ipfs/go-ipfs/util"
18 )
19
20 -var log = eventlog.Logger("backpressure")
20 +var log = logging.Logger("backpressure")
21
22 // TestBackpressureStreamHandler tests whether mux handler
23 // ratelimiting works. Meaning, since the handler is sequential
p2p/test/reconnects/reconnect_test.go
+2 -2
@@ -12,7 +12,7 @@ import (
12 swarm "github.com/ipfs/go-ipfs/p2p/net/swarm"
13 protocol "github.com/ipfs/go-ipfs/p2p/protocol"
14 testutil "github.com/ipfs/go-ipfs/p2p/test/util"
15 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
15 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
16 u "github.com/ipfs/go-ipfs/util"
17
18 ps "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-peerstream"
@@ -24,7 +24,7 @@ func init() {
24 ps.GarbageCollectTimeout = 10 * time.Millisecond
25 }
26
27 -var log = eventlog.Logger("reconnect")
27 +var log = logging.Logger("reconnect")
28
29 func EchoStreamHandler(stream inet.Stream) {
30 c := stream.Conn()
p2p/test/util/key.go
+2 -2
@@ -5,7 +5,7 @@ import (
5 "io"
6 "testing"
7
8 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
8 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
9 u "github.com/ipfs/go-ipfs/util"
10 testutil "github.com/ipfs/go-ipfs/util/testutil"
11
@@ -15,7 +15,7 @@ import (
15 ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
16 )
17
18 -var log = eventlog.Logger("boguskey")
18 +var log = logging.Logger("boguskey")
19
20 // TestBogusPrivateKey is a key used for testing (to avoid expensive keygen)
21 type TestBogusPrivateKey []byte
package.json
+5
@@ -5,6 +5,11 @@
5 {
6 "name": "dir-index-html",
7 "hash": "QmdDfkqDWheE4gsCXNrhixwTwSHnZMPT2cGLcNbiBNcMyU"
8 + },
9 + {
10 + "name": "go-log",
11 + "hash": "QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8",
12 + "linkname": "go-log-v1.0.0"
13 }
14 ]
15 }
\ No newline at end of file
path/resolver.go
+2 -2
@@ -11,10 +11,10 @@ import (
11
12 key "github.com/ipfs/go-ipfs/blocks/key"
13 merkledag "github.com/ipfs/go-ipfs/merkledag"
14 - u "github.com/ipfs/go-ipfs/util"
14 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
15 )
16
17 -var log = u.Logger("path")
17 +var log = logging.Logger("path")
18
19 // Paths after a protocol must contain at least one component
20 var ErrNoComponents = errors.New(
pin/pin.go
+2 -2
@@ -14,10 +14,10 @@ import (
14 key "github.com/ipfs/go-ipfs/blocks/key"
15 "github.com/ipfs/go-ipfs/blocks/set"
16 mdag "github.com/ipfs/go-ipfs/merkledag"
17 - "github.com/ipfs/go-ipfs/util"
17 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
18 )
19
20 -var log = util.Logger("pin")
20 +var log = logging.Logger("pin")
21 var recursePinDatastoreKey = ds.NewKey("/local/pins/recursive/keys")
22 var directPinDatastoreKey = ds.NewKey("/local/pins/direct/keys")
23 var indirectPinDatastoreKey = ds.NewKey("/local/pins/indirect/keys")
repo/config/config.go
+2 -1
@@ -10,9 +10,10 @@ import (
10 "strings"
11
12 u "github.com/ipfs/go-ipfs/util"
13 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
14 )
15
15 -var log = u.Logger("config")
16 +var log = logging.Logger("config")
17
18 // Config is used to load IPFS config files.
19 type Config struct {
repo/fsrepo/fsrepo.go
+5 -5
@@ -23,10 +23,10 @@ import (
23 mfsr "github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
24 serialize "github.com/ipfs/go-ipfs/repo/fsrepo/serialize"
25 dir "github.com/ipfs/go-ipfs/thirdparty/dir"
26 - "github.com/ipfs/go-ipfs/thirdparty/eventlog"
26 u "github.com/ipfs/go-ipfs/util"
27 util "github.com/ipfs/go-ipfs/util"
28 ds2 "github.com/ipfs/go-ipfs/util/datastore2"
29 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
30 )
31
32 // version number that we are currently expecting to see
@@ -406,9 +406,9 @@ func (r *FSRepo) openDatastore() error {
406 }
407
408 func configureEventLoggerAtRepoPath(c *config.Config, repoPath string) {
409 - eventlog.Configure(eventlog.LevelInfo)
410 - eventlog.Configure(eventlog.LdJSONFormatter)
411 - eventlog.Configure(eventlog.Output(eventlog.WriterGroup))
409 + logging.Configure(logging.LevelInfo)
410 + logging.Configure(logging.LdJSONFormatter)
411 + logging.Configure(logging.Output(logging.WriterGroup))
412 }
413
414 // Close closes the FSRepo, releasing held resources.
@@ -436,7 +436,7 @@ func (r *FSRepo) Close() error {
436 //
437 // TODO It isn't part of the current contract, but callers may like for us
438 // to disable logging once the component is closed.
439 - // eventlog.Configure(eventlog.Output(os.Stderr))
439 + // logging.Configure(logging.Output(os.Stderr))
440
441 r.closed = true
442 if err := r.lockfile.Close(); err != nil {
repo/fsrepo/serialize/serialize.go
+2 -1
@@ -11,9 +11,10 @@ import (
11 "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/facebookgo/atomicfile"
12 "github.com/ipfs/go-ipfs/repo/config"
13 "github.com/ipfs/go-ipfs/util"
14 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
15 )
16
16 -var log = util.Logger("fsrepo")
17 +var log = logging.Logger("fsrepo")
18
19 // ReadConfigFile reads the config from `filename` into `cfg`.
20 func ReadConfigFile(filename string, cfg interface{}) error {
routing/dht/dht.go
+3 -3
@@ -18,8 +18,8 @@ import (
18 pb "github.com/ipfs/go-ipfs/routing/dht/pb"
19 kb "github.com/ipfs/go-ipfs/routing/kbucket"
20 record "github.com/ipfs/go-ipfs/routing/record"
21 - "github.com/ipfs/go-ipfs/thirdparty/eventlog"
21 u "github.com/ipfs/go-ipfs/util"
22 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
23
24 proto "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
25 ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
@@ -28,7 +28,7 @@ import (
28 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
29 )
30
31 -var log = eventlog.Logger("dht")
31 +var log = logging.Logger("dht")
32
33 var ProtocolDHT protocol.ID = "/ipfs/dht"
34
@@ -98,7 +98,7 @@ func (dht *IpfsDHT) LocalPeer() peer.ID {
98 }
99
100 // log returns the dht's logger
101 -func (dht *IpfsDHT) log() eventlog.EventLogger {
101 +func (dht *IpfsDHT) log() logging.EventLogger {
102 return log // TODO rm
103 }
104
routing/dht/pb/message.go
+2 -2
@@ -6,10 +6,10 @@ import (
6 key "github.com/ipfs/go-ipfs/blocks/key"
7 inet "github.com/ipfs/go-ipfs/p2p/net"
8 peer "github.com/ipfs/go-ipfs/p2p/peer"
9 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
9 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
10 )
11
12 -var log = eventlog.Logger("dht.pb")
12 +var log = logging.Logger("dht.pb")
13
14 type PeerRoutingInfo struct {
15 peer.PeerInfo
routing/dht/query.go
+2 -2
@@ -8,10 +8,10 @@ import (
8 peer "github.com/ipfs/go-ipfs/p2p/peer"
9 queue "github.com/ipfs/go-ipfs/p2p/peer/queue"
10 "github.com/ipfs/go-ipfs/routing"
11 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
11 u "github.com/ipfs/go-ipfs/util"
12 pset "github.com/ipfs/go-ipfs/util/peerset"
13 todoctr "github.com/ipfs/go-ipfs/util/todocounter"
14 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
15
16 process "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
17 ctxproc "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context"
@@ -77,7 +77,7 @@ type dhtQueryRunner struct {
77 errs u.MultiErr // result errors. maybe should be a map[peer.ID]error
78
79 rateLimit chan struct{} // processing semaphore
80 - log eventlog.EventLogger
80 + log logging.EventLogger
81
82 proc process.Process
83 sync.RWMutex
routing/kbucket/table.go
+2 -2
@@ -8,10 +8,10 @@ import (
8 "time"
9
10 peer "github.com/ipfs/go-ipfs/p2p/peer"
11 - u "github.com/ipfs/go-ipfs/util"
11 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
12 )
13
14 -var log = u.Logger("table")
14 +var log = logging.Logger("table")
15
16 // RoutingTable defines the routing table.
17 type RoutingTable struct {
routing/mock/centralized_client.go
+2 -2
@@ -10,11 +10,11 @@ import (
10 key "github.com/ipfs/go-ipfs/blocks/key"
11 peer "github.com/ipfs/go-ipfs/p2p/peer"
12 routing "github.com/ipfs/go-ipfs/routing"
13 - u "github.com/ipfs/go-ipfs/util"
13 "github.com/ipfs/go-ipfs/util/testutil"
14 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
15 )
16
17 -var log = u.Logger("mockrouter")
17 +var log = logging.Logger("mockrouter")
18
19 type client struct {
20 datastore ds.Datastore
routing/none/none_client.go
+2 -2
@@ -9,10 +9,10 @@ import (
9 p2phost "github.com/ipfs/go-ipfs/p2p/host"
10 peer "github.com/ipfs/go-ipfs/p2p/peer"
11 routing "github.com/ipfs/go-ipfs/routing"
12 - u "github.com/ipfs/go-ipfs/util"
12 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
13 )
14
15 -var log = u.Logger("mockrouter")
15 +var log = logging.Logger("mockrouter")
16
17 type nilclient struct {
18 }
routing/offline/offline.go
+2 -2
@@ -13,10 +13,10 @@ import (
13 routing "github.com/ipfs/go-ipfs/routing"
14 pb "github.com/ipfs/go-ipfs/routing/dht/pb"
15 record "github.com/ipfs/go-ipfs/routing/record"
16 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
16 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
17 )
18
19 -var log = eventlog.Logger("offlinerouting")
19 +var log = logging.Logger("offlinerouting")
20
21 var ErrOffline = errors.New("routing system in offline mode")
22
routing/record/record.go
+2 -2
@@ -9,11 +9,11 @@ import (
9 dag "github.com/ipfs/go-ipfs/merkledag"
10 ci "github.com/ipfs/go-ipfs/p2p/crypto"
11 pb "github.com/ipfs/go-ipfs/routing/dht/pb"
12 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
12 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
13 )
14
15 var _ = dag.FetchGraph
16 -var log = eventlog.Logger("routing/record")
16 +var log = logging.Logger("routing/record")
17
18 // MakePutRecord creates and signs a dht record for the given key/value pair
19 func MakePutRecord(sk ci.PrivKey, key key.Key, value []byte, sign bool) (*pb.Record, error) {
routing/supernode/client.go
+3 -3
@@ -14,10 +14,10 @@ import (
14 routing "github.com/ipfs/go-ipfs/routing"
15 pb "github.com/ipfs/go-ipfs/routing/dht/pb"
16 proxy "github.com/ipfs/go-ipfs/routing/supernode/proxy"
17 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
17 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
18 )
19
20 -var log = eventlog.Logger("supernode")
20 +var log = logging.Logger("supernode")
21
22 type Client struct {
23 peerhost host.Host
@@ -37,7 +37,7 @@ func NewClient(px proxy.Proxy, h host.Host, ps peer.Peerstore, local peer.ID) (*
37 }
38
39 func (c *Client) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan peer.PeerInfo {
40 - ctx = eventlog.ContextWithLoggable(ctx, eventlog.Uuid("findProviders"))
40 + ctx = logging.ContextWithLoggable(ctx, logging.Uuid("findProviders"))
41 defer log.EventBegin(ctx, "findProviders", &k).Done()
42 ch := make(chan peer.PeerInfo)
43 go func() {
routing/supernode/proxy/standard.go
+5 -5
@@ -12,12 +12,12 @@ import (
12 peer "github.com/ipfs/go-ipfs/p2p/peer"
13 dhtpb "github.com/ipfs/go-ipfs/routing/dht/pb"
14 kbucket "github.com/ipfs/go-ipfs/routing/kbucket"
15 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
15 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
16 )
17
18 const ProtocolSNR = "/ipfs/supernoderouting"
19
20 -var log = eventlog.Logger("supernode/proxy")
20 +var log = logging.Logger("supernode/proxy")
21
22 type Proxy interface {
23 Bootstrap(context.Context) error
@@ -127,7 +127,7 @@ func (px *standard) SendRequest(ctx context.Context, m *dhtpb.Message) (*dhtpb.M
127 }
128
129 func (px *standard) sendRequest(ctx context.Context, m *dhtpb.Message, remote peer.ID) (*dhtpb.Message, error) {
130 - e := log.EventBegin(ctx, "sendRoutingRequest", px.Host.ID(), remote, eventlog.Pair("request", m))
130 + e := log.EventBegin(ctx, "sendRoutingRequest", px.Host.ID(), remote, logging.Pair("request", m))
131 defer e.Done()
132 if err := px.Host.Connect(ctx, peer.PeerInfo{ID: remote}); err != nil {
133 e.SetError(err)
@@ -157,8 +157,8 @@ func (px *standard) sendRequest(ctx context.Context, m *dhtpb.Message, remote pe
157 e.SetError(err)
158 return nil, err
159 }
160 - e.Append(eventlog.Pair("response", response))
161 - e.Append(eventlog.Pair("uuid", eventlog.Uuid("foo")))
160 + e.Append(logging.Pair("response", response))
161 + e.Append(logging.Pair("uuid", logging.Uuid("foo")))
162 return response, nil
163 }
164
tar/format.go
+2 -2
@@ -13,12 +13,12 @@ import (
13 dag "github.com/ipfs/go-ipfs/merkledag"
14 dagutil "github.com/ipfs/go-ipfs/merkledag/utils"
15 uio "github.com/ipfs/go-ipfs/unixfs/io"
16 - u "github.com/ipfs/go-ipfs/util"
16 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
17
18 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
19 )
20
21 -var log = u.Logger("tarfmt")
21 +var log = logging.Logger("tarfmt")
22
23 var blockSize = 512
24 var zeroBlock = make([]byte, blockSize)
test/integration/addcat_test.go
+2 -2
@@ -18,12 +18,12 @@ import (
18 mock "github.com/ipfs/go-ipfs/core/mock"
19 mocknet "github.com/ipfs/go-ipfs/p2p/net/mock"
20 "github.com/ipfs/go-ipfs/p2p/peer"
21 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
21 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
22 "github.com/ipfs/go-ipfs/thirdparty/unit"
23 testutil "github.com/ipfs/go-ipfs/util/testutil"
24 )
25
26 -var log = eventlog.Logger("epictest")
26 +var log = logging.Logger("epictest")
27
28 const kSeed = 1
29
test/supernode_client/main.go
+3 -3
@@ -28,12 +28,12 @@ import (
28 "github.com/ipfs/go-ipfs/repo"
29 config "github.com/ipfs/go-ipfs/repo/config"
30 fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
31 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
31 unit "github.com/ipfs/go-ipfs/thirdparty/unit"
32 ds2 "github.com/ipfs/go-ipfs/util/datastore2"
33 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
34 )
35
36 -var elog = eventlog.Logger("gc-client")
36 +var elog = logging.Logger("gc-client")
37
38 var (
39 cat = flag.Bool("cat", false, "else add")
@@ -193,7 +193,7 @@ func runFileCattingWorker(ctx context.Context, n *core.IpfsNode) error {
193 if err != nil {
194 log.Fatal(err)
195 }
196 - e := elog.EventBegin(ctx, "cat", eventlog.LoggableF(func() map[string]interface{} {
196 + e := elog.EventBegin(ctx, "cat", logging.LoggableF(func() map[string]interface{} {
197 return map[string]interface{}{
198 "key": k,
199 "localPeer": n.Identity,
tour/tour.go
+2 -2
@@ -4,10 +4,10 @@ import (
4 "strconv"
5 "strings"
6
7 - u "github.com/ipfs/go-ipfs/util"
7 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
8 )
9
10 -var log = u.Logger("tour")
10 +var log = logging.Logger("tour")
11
12 // ID is a string identifier for topics
13 type ID string
unixfs/mod/dagmodifier.go
+2 -2
@@ -19,7 +19,7 @@ import (
19 pin "github.com/ipfs/go-ipfs/pin"
20 ft "github.com/ipfs/go-ipfs/unixfs"
21 uio "github.com/ipfs/go-ipfs/unixfs/io"
22 - u "github.com/ipfs/go-ipfs/util"
22 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
23 )
24
25 var ErrSeekFail = errors.New("failed to seek properly")
@@ -29,7 +29,7 @@ var ErrUnrecognizedWhence = errors.New("unrecognized whence")
29 // 2MB
30 var writebufferSize = 1 << 21
31
32 -var log = u.Logger("dagio")
32 +var log = logging.Logger("dagio")
33
34 // DagModifier is the only struct licensed and able to correctly
35 // perform surgery on a DAG 'file'
updates/updates.go
+2 -2
@@ -8,7 +8,7 @@ import (
8
9 config "github.com/ipfs/go-ipfs/repo/config"
10 fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
11 - u "github.com/ipfs/go-ipfs/util"
11 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
12
13 semver "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/coreos/go-semver/semver"
14 update "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/inconshreveable/go-update"
@@ -79,7 +79,7 @@ AAb7RaEDNJOa7qvUFecB
79
80 )
81
82 -var log = u.Logger("updates")
82 +var log = logging.Logger("updates")
83
84 var currentVersion *semver.Version
85
util/eventlog/loggables/loggables.go
+5 -5
@@ -11,22 +11,22 @@ import (
11
12 ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
13
14 - log "github.com/ipfs/go-ipfs/thirdparty/eventlog"
14 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
15
16 peer "github.com/ipfs/go-ipfs/p2p/peer"
17 )
18
19 // NetConn returns an eventlog.Metadata with the conn addresses
20 -func NetConn(c net.Conn) log.Loggable {
21 - return log.Metadata{
20 +func NetConn(c net.Conn) logging.Loggable {
21 + return logging.Metadata{
22 "localAddr": c.LocalAddr(),
23 "remoteAddr": c.RemoteAddr(),
24 }
25 }
26
27 // Error returns an eventlog.Metadata with an error
28 -func Error(e error) log.Loggable {
29 - return log.Metadata{
28 +func Error(e error) logging.Loggable {
29 + return logging.Metadata{
30 "error": e.Error(),
31 }
32 }
util/ipfsaddr/ipfsaddr.go
+2 -2
@@ -7,10 +7,10 @@ import (
7 ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
8
9 peer "github.com/ipfs/go-ipfs/p2p/peer"
10 - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
10 + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
11 )
12
13 -var log = eventlog.Logger("ipfsaddr")
13 +var log = logging.Logger("ipfsaddr")
14
15 // ErrInvalidAddr signals an address is not a valid ipfs address.
16 var ErrInvalidAddr = errors.New("invalid ipfs address")
util/util.go
-3
@@ -35,9 +35,6 @@ var ErrSearchIncomplete = errors.New("Error: Search Incomplete.")
35 // ErrNotFound is returned when a search fails to find anything
36 var ErrNotFound = ds.ErrNotFound
37
38 -// ErrNoSuchLogger is returned when the util pkg is asked for a non existant logger
39 -var ErrNoSuchLogger = errors.New("Error: No such logger")
40 -
38 // TildeExpansion expands a filename, which may begin with a tilde.
39 func TildeExpansion(filename string) (string, error) {
40 return homedir.Expand(filename)
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/context.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import (
4 "errors"
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/context_test.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import (
4 "testing"
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/entry.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import (
4 "time"
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/example_test.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
4
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/log.go renamed
+11 -3
@@ -1,11 +1,10 @@
1 -package eventlog
1 +package log
2
3 import (
4 "fmt"
5 "time"
6
7 context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
8 - "github.com/ipfs/go-ipfs/util" // TODO remove IPFS dependency
8 )
9
10 // StandardLogger provides API compatibility with standard printf loggers
@@ -53,7 +52,16 @@ func Logger(system string) EventLogger {
52
53 // TODO if we would like to adjust log levels at run-time. Store this event
54 // logger in a map (just like the util.Logger impl)
56 - return &eventLogger{system: system, StandardLogger: util.Logger(system)}
55 + if len(system) == 0 {
56 + log.Warnf("Missing name parameter")
57 + system = "undefined"
58 + }
59 + if _, ok := loggers[system]; !ok {
60 + loggers[system] = log.WithField("module", system)
61 + }
62 + logger := loggers[system]
63 +
64 + return &eventLogger{system: system, StandardLogger: logger}
65 }
66
67 // eventLogger implements the EventLogger and wraps a go-logging Logger
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/loggable.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 // Loggable describes objects that can be marshalled into Metadata for logging
4 type Loggable interface {
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/metadata.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import (
4 "encoding/json"
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/metadata_test.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import "testing"
4
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/oldlog.go renamed
+5 -17
@@ -1,6 +1,7 @@
1 -package util
1 +package log
2
3 import (
4 + "errors"
5 "os"
6
7 "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/Sirupsen/logrus"
@@ -27,6 +28,9 @@ const (
28 envLoggingFmt = "IPFS_LOGGING_FMT"
29 )
30
31 +// ErrNoSuchLogger is returned when the util pkg is asked for a non existant logger
32 +var ErrNoSuchLogger = errors.New("Error: No such logger")
33 +
34 // loggers is the set of loggers in the system
35 var loggers = map[string]*logrus.Entry{}
36
@@ -52,10 +56,6 @@ func SetupLogging() {
56 }
57 }
58
55 - if Debug := GetenvBool("IPFS_DEBUG"); Debug {
56 - lvl = logrus.DebugLevel
57 - }
58 -
59 SetAllLoggers(lvl)
60 }
61
@@ -72,18 +72,6 @@ func SetAllLoggers(lvl logrus.Level) {
72 }
73 }
74
75 -// Logger retrieves a particular logger
76 -func Logger(name string) *logrus.Entry {
77 - if len(name) == 0 {
78 - log.Warnf("Missing name parameter")
79 - name = "undefined"
80 - }
81 - if _, ok := loggers[name]; !ok {
82 - loggers[name] = log.WithField("module", name)
83 - }
84 - return loggers[name]
85 -}
86 -
75 // SetLogLevel changes the log level of a specific subsystem
76 // name=="*" changes all subsystems
77 func SetLogLevel(name, level string) error {
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/option.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import (
4 "io"
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/package.json new
+5
@@ -0,0 +1,5 @@
1 +{
2 + "name": "go-log",
3 + "version": "1.0.0",
4 + "language": "go"
5 +}
\ No newline at end of file
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/polite_json_formatter.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import (
4 "encoding/json"
vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/writer.go renamed
+1 -1
@@ -1,4 +1,4 @@
1 -package eventlog
1 +package log
2
3 import (
4 "io"
vendor/go-log-v1.0.0 new
+1
@@ -0,0 +1 @@
1 +QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log
\ No newline at end of file