diff --git a/blocks/blockstore/blockstore.go b/blocks/blockstore/blockstore.go index 63fa7f9eb..90a3b9264 100644 --- a/blocks/blockstore/blockstore.go +++ b/blocks/blockstore/blockstore.go @@ -12,10 +12,10 @@ import ( context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" blocks "github.com/ipfs/go-ipfs/blocks" key "github.com/ipfs/go-ipfs/blocks/key" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("blockstore") +var log = logging.Logger("blockstore") // BlockPrefix namespaces blockstore datastores var BlockPrefix = ds.NewKey("blocks") diff --git a/blocks/set/set.go b/blocks/set/set.go index 33d938e11..8a43bbb02 100644 --- a/blocks/set/set.go +++ b/blocks/set/set.go @@ -4,10 +4,10 @@ package set import ( "github.com/ipfs/go-ipfs/blocks/bloom" key "github.com/ipfs/go-ipfs/blocks/key" - "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = util.Logger("blockset") +var log = logging.Logger("blockset") // BlockSet represents a mutable set of keyed blocks type BlockSet interface { diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index 40197c5ba..3ab6bc1dc 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -12,7 +12,7 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" worker "github.com/ipfs/go-ipfs/blockservice/worker" exchange "github.com/ipfs/go-ipfs/exchange" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) var wc = worker.Config{ @@ -32,7 +32,7 @@ var wc = worker.Config{ WorkerBufferSize: 0, } -var log = u.Logger("blockservice") +var log = logging.Logger("blockservice") var ErrNotFound = errors.New("blockservice: key not found") // BlockService is a hybrid block datastore. It stores data in a local diff --git a/blockservice/worker/worker.go b/blockservice/worker/worker.go index 88149add3..3b4df2d73 100644 --- a/blockservice/worker/worker.go +++ b/blockservice/worker/worker.go @@ -12,10 +12,11 @@ import ( blocks "github.com/ipfs/go-ipfs/blocks" key "github.com/ipfs/go-ipfs/blocks/key" exchange "github.com/ipfs/go-ipfs/exchange" - util "github.com/ipfs/go-ipfs/util" + + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = util.Logger("blockservice") +var log = logging.Logger("blockservice") var DefaultConfig = Config{ NumWorkers: 1, diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index 3457d8ab6..cc37aae41 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -27,12 +27,12 @@ import ( repo "github.com/ipfs/go-ipfs/repo" config "github.com/ipfs/go-ipfs/repo/config" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - 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" ) // log is the command logger -var log = eventlog.Logger("cmd/ipfs") +var log = logging.Logger("cmd/ipfs") var ( errUnexpectedApiOutput = errors.New("api returned unexpected output") @@ -62,7 +62,7 @@ type cmdInvocation struct { func main() { rand.Seed(time.Now().UnixNano()) runtime.GOMAXPROCS(3) // FIXME rm arbitrary choice for n - ctx := eventlog.ContextWithLoggable(context.Background(), eventlog.Uuid("session")) + ctx := logging.ContextWithLoggable(context.Background(), logging.Uuid("session")) var err error var invoc cmdInvocation defer invoc.close() @@ -175,7 +175,7 @@ func (i *cmdInvocation) Run(ctx context.Context) (output io.Reader, err error) { } if debug || u.GetenvBool("DEBUG") || os.Getenv("IPFS_LOGGING") == "debug" { u.Debug = true - u.SetDebugLogging() + logging.SetDebugLogging() } res, err := callCommand(ctx, i.req, Root, i.cmd) diff --git a/cmd/seccat/seccat.go b/cmd/seccat/seccat.go index 31890413e..9829bfc9d 100644 --- a/cmd/seccat/seccat.go +++ b/cmd/seccat/seccat.go @@ -21,7 +21,7 @@ import ( ci "github.com/ipfs/go-ipfs/p2p/crypto" secio "github.com/ipfs/go-ipfs/p2p/crypto/secio" peer "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 verbose = false @@ -93,7 +93,7 @@ func main() { args := parseArgs() verbose = args.verbose if args.debug { - u.SetDebugLogging() + logging.SetDebugLogging() } go func() { diff --git a/cmd/seccat/util.go b/cmd/seccat/util.go index d7042050c..fbe3f3901 100644 --- a/cmd/seccat/util.go +++ b/cmd/seccat/util.go @@ -5,10 +5,10 @@ import ( "io" "os" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("seccat") +var log = logging.Logger("seccat") func exit(format string, vals ...interface{}) { if format != "" { diff --git a/commands/command.go b/commands/command.go index e9774b85b..905c729a3 100644 --- a/commands/command.go +++ b/commands/command.go @@ -15,10 +15,10 @@ import ( "reflect" "strings" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("command") +var log = logging.Logger("command") // Function is the type of function that Commands use. // It reads from the Request, and writes results to the Response. diff --git a/commands/http/handler.go b/commands/http/handler.go index 46be09e49..724b3bfa3 100644 --- a/commands/http/handler.go +++ b/commands/http/handler.go @@ -16,10 +16,10 @@ import ( context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" cmds "github.com/ipfs/go-ipfs/commands" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("commands/http") +var log = logging.Logger("commands/http") // the internal handler for the API type internalHandler struct { diff --git a/core/commands/log.go b/core/commands/log.go index 848b86f79..28f2b3c6e 100644 --- a/core/commands/log.go +++ b/core/commands/log.go @@ -5,8 +5,7 @@ import ( "io" cmds "github.com/ipfs/go-ipfs/commands" - "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" ) // Golang os.Args overrides * and replaces the character argument with @@ -54,7 +53,7 @@ output of a running daemon. subsystem = "*" } - if err := u.SetLogLevel(subsystem, level); err != nil { + if err := logging.SetLogLevel(subsystem, level); err != nil { res.SetError(err, cmds.ErrNormal) return } @@ -79,7 +78,7 @@ var logTailCmd = &cmds.Command{ Run: func(req cmds.Request, res cmds.Response) { r, w := io.Pipe() - eventlog.WriterGroup.AddWriter(w) + logging.WriterGroup.AddWriter(w) go func() { <-req.Context().Done() w.Close() diff --git a/core/commands/root.go b/core/commands/root.go index 987178058..7953e3fbd 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -6,10 +6,10 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" unixfs "github.com/ipfs/go-ipfs/core/commands/unixfs" - evlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = evlog.Logger("core/commands") +var log = logging.Logger("core/commands") type TestOutput struct { Foo string diff --git a/core/core.go b/core/core.go index 6b6dbd03f..5f246c833 100644 --- a/core/core.go +++ b/core/core.go @@ -33,7 +33,7 @@ import ( addrutil "github.com/ipfs/go-ipfs/p2p/net/swarm/addr" peer "github.com/ipfs/go-ipfs/p2p/peer" ping "github.com/ipfs/go-ipfs/p2p/protocol/ping" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" routing "github.com/ipfs/go-ipfs/routing" dht "github.com/ipfs/go-ipfs/routing/dht" @@ -62,7 +62,7 @@ const kSizeBlockstoreWriteCache = 100 const kReprovideFrequency = time.Hour * 12 const discoveryConnTimeout = time.Second * 30 -var log = eventlog.Logger("core") +var log = logging.Logger("core") type mode int diff --git a/core/corehttp/corehttp.go b/core/corehttp/corehttp.go index dc221f3cd..9662c25f1 100644 --- a/core/corehttp/corehttp.go +++ b/core/corehttp/corehttp.go @@ -14,10 +14,10 @@ import ( manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net" "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess" core "github.com/ipfs/go-ipfs/core" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("core/server") +var log = logging.Logger("core/server") // ServeOption registers any HTTP handlers it provides on the given mux. // It returns the mux to expose to future options, which may be a new mux if it diff --git a/core/corehttp/logs.go b/core/corehttp/logs.go index 59b87b9bc..e0bcc3c6e 100644 --- a/core/corehttp/logs.go +++ b/core/corehttp/logs.go @@ -6,7 +6,7 @@ import ( "net/http" core "github.com/ipfs/go-ipfs/core" - "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) type writeErrNotifier struct { @@ -41,7 +41,7 @@ func LogOption() ServeOption { mux.HandleFunc("/logs", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) wnf, errs := newWriteErrNotifier(w) - eventlog.WriterGroup.AddWriter(wnf) + logging.WriterGroup.AddWriter(wnf) log.Event(n.Context(), "log API client connected") <-errs }) diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index 6b284d03f..1c64ed13a 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -5,10 +5,10 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" "github.com/ipfs/go-ipfs/core" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("corerepo") +var log = logging.Logger("corerepo") type KeyRemoved struct { Key key.Key diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 40eaa4017..eef157a78 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -14,11 +14,11 @@ import ( chunk "github.com/ipfs/go-ipfs/importer/chunk" merkledag "github.com/ipfs/go-ipfs/merkledag" "github.com/ipfs/go-ipfs/pin" - "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" unixfs "github.com/ipfs/go-ipfs/unixfs" ) -var log = eventlog.Logger("coreunix") +var log = logging.Logger("coreunix") // Add builds a merkledag from the a reader, pinning all objects to the local // datastore. Returns a key representing the root node. diff --git a/diagnostics/diag.go b/diagnostics/diag.go index 3877ee139..64b910680 100644 --- a/diagnostics/diag.go +++ b/diagnostics/diag.go @@ -20,10 +20,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" - util "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = util.Logger("diagnostics") +var log = logging.Logger("diagnostics") // ProtocolDiag is the diagnostics protocol.ID var ProtocolDiag protocol.ID = "/ipfs/diagnostics" diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index 8bc88481b..ad472f327 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -22,10 +22,10 @@ import ( wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" peer "github.com/ipfs/go-ipfs/p2p/peer" "github.com/ipfs/go-ipfs/thirdparty/delay" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("bitswap") +var log = logging.Logger("bitswap") const ( // 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 ctx, cancelFunc := context.WithCancel(parent) - ctx = eventlog.ContextWithLoggable(ctx, eventlog.Uuid("GetBlockRequest")) + ctx = logging.ContextWithLoggable(ctx, logging.Uuid("GetBlockRequest")) log.Event(ctx, "Bitswap.GetBlockRequest.Start", &k) defer log.Event(ctx, "Bitswap.GetBlockRequest.End", &k) diff --git a/exchange/bitswap/decision/engine.go b/exchange/bitswap/decision/engine.go index d08636d80..85dde9eb7 100644 --- a/exchange/bitswap/decision/engine.go +++ b/exchange/bitswap/decision/engine.go @@ -10,7 +10,7 @@ import ( bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" wl "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" 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" ) // TODO consider taking responsibility for other types of requests. For @@ -43,7 +43,7 @@ import ( // whatever it sees fit to produce desired outcomes (get wanted keys // quickly, maintain good relationships with peers, etc). -var log = eventlog.Logger("engine") +var log = logging.Logger("engine") const ( // outboxChanBuffer must be 0 to prevent stale messages from being sent diff --git a/exchange/bitswap/network/ipfs_impl.go b/exchange/bitswap/network/ipfs_impl.go index 78d1defd3..c0a4b2d3a 100644 --- a/exchange/bitswap/network/ipfs_impl.go +++ b/exchange/bitswap/network/ipfs_impl.go @@ -9,10 +9,10 @@ import ( inet "github.com/ipfs/go-ipfs/p2p/net" peer "github.com/ipfs/go-ipfs/p2p/peer" routing "github.com/ipfs/go-ipfs/routing" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("bitswap_network") +var log = logging.Logger("bitswap_network") // NewFromIpfsHost returns a BitSwapNetwork supported by underlying IPFS host func NewFromIpfsHost(host host.Host, r routing.IpfsRouting) BitSwapNetwork { diff --git a/exchange/bitswap/workers.go b/exchange/bitswap/workers.go index b33ea9221..41dd94abe 100644 --- a/exchange/bitswap/workers.go +++ b/exchange/bitswap/workers.go @@ -9,7 +9,7 @@ import ( context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" key "github.com/ipfs/go-ipfs/blocks/key" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) var TaskWorkerCount = 8 @@ -45,7 +45,7 @@ func (bs *Bitswap) startWorkers(px process.Process, ctx context.Context) { } func (bs *Bitswap) taskWorker(ctx context.Context, id int) { - idmap := eventlog.LoggableMap{"ID": id} + idmap := logging.LoggableMap{"ID": id} defer log.Info("bitswap task worker shutting down...") for { log.Event(ctx, "Bitswap.TaskWorker.Loop", idmap) @@ -56,7 +56,7 @@ func (bs *Bitswap) taskWorker(ctx context.Context, id int) { if !ok { continue } - log.Event(ctx, "Bitswap.TaskWorker.Work", eventlog.LoggableMap{ + log.Event(ctx, "Bitswap.TaskWorker.Work", logging.LoggableMap{ "ID": id, "Target": envelope.Peer.Pretty(), "Block": envelope.Block.Multihash.B58String(), @@ -77,7 +77,7 @@ func (bs *Bitswap) provideWorker(px process.Process) { limiter := ratelimit.NewRateLimiter(px, provideWorkerMax) limitedGoProvide := func(k key.Key, wid int) { - ev := eventlog.LoggableMap{"ID": wid} + ev := logging.LoggableMap{"ID": wid} limiter.LimitedGo(func(px process.Process) { ctx := procctx.OnClosingContext(px) // derive ctx from px @@ -96,7 +96,7 @@ func (bs *Bitswap) provideWorker(px process.Process) { // _ratelimited_ number of workers to handle each key. limiter.Go(func(px process.Process) { for wid := 2; ; wid++ { - ev := eventlog.LoggableMap{"ID": 1} + ev := logging.LoggableMap{"ID": 1} log.Event(procctx.OnClosingContext(px), "Bitswap.ProvideWorker.Loop", ev) select { @@ -158,7 +158,7 @@ func (bs *Bitswap) providerConnector(parent context.Context) { log.Warning("Received batch request for zero blocks") continue } - log.Event(parent, "Bitswap.ProviderConnector.Work", eventlog.LoggableMap{"Keys": keys}) + log.Event(parent, "Bitswap.ProviderConnector.Work", logging.LoggableMap{"Keys": keys}) // NB: Optimization. Assumes that providers of key[0] are likely to // be able to provide for all keys. This currently holds true in most diff --git a/exchange/reprovide/reprovide.go b/exchange/reprovide/reprovide.go index 203a48e29..0b6ea750b 100644 --- a/exchange/reprovide/reprovide.go +++ b/exchange/reprovide/reprovide.go @@ -8,10 +8,10 @@ import ( context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" blocks "github.com/ipfs/go-ipfs/blocks/blockstore" routing "github.com/ipfs/go-ipfs/routing" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("reprovider") +var log = logging.Logger("reprovider") type Reprovider struct { // The routing system to provide values through diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index e01b03136..30258abf9 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -13,7 +13,7 @@ import ( fuse "github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse" fs "github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs" "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" key "github.com/ipfs/go-ipfs/blocks/key" core "github.com/ipfs/go-ipfs/core" @@ -23,7 +23,7 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" ) -var log = eventlog.Logger("fuse/ipns") +var log = logging.Logger("fuse/ipns") // FileSystem is the readwrite IPNS Fuse Filesystem. type FileSystem struct { diff --git a/fuse/mount/mount.go b/fuse/mount/mount.go index 5ec8d597f..1e5af4fc1 100644 --- a/fuse/mount/mount.go +++ b/fuse/mount/mount.go @@ -10,10 +10,10 @@ import ( goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("mount") +var log = logging.Logger("mount") var MountTimeout = time.Second * 5 diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 275c0d90c..22ef2ace6 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -16,13 +16,13 @@ import ( core "github.com/ipfs/go-ipfs/core" mdag "github.com/ipfs/go-ipfs/merkledag" path "github.com/ipfs/go-ipfs/path" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" uio "github.com/ipfs/go-ipfs/unixfs/io" ftpb "github.com/ipfs/go-ipfs/unixfs/pb" lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables" ) -var log = eventlog.Logger("fuse/ipfs") +var log = logging.Logger("fuse/ipfs") // FileSystem is the readonly Ipfs Fuse Filesystem. type FileSystem struct { diff --git a/importer/chunk/splitting.go b/importer/chunk/splitting.go index 960947245..31b5c03e5 100644 --- a/importer/chunk/splitting.go +++ b/importer/chunk/splitting.go @@ -4,10 +4,10 @@ package chunk import ( "io" - "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = util.Logger("chunk") +var log = logging.Logger("chunk") var DefaultBlockSize int64 = 1024 * 256 diff --git a/importer/importer.go b/importer/importer.go index cd197c473..29c365f60 100644 --- a/importer/importer.go +++ b/importer/importer.go @@ -13,10 +13,10 @@ import ( trickle "github.com/ipfs/go-ipfs/importer/trickle" dag "github.com/ipfs/go-ipfs/merkledag" "github.com/ipfs/go-ipfs/pin" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("importer") +var log = logging.Logger("importer") // Builds a DAG from the given file, writing created blocks to disk as they are // created diff --git a/ipnsfs/system.go b/ipnsfs/system.go index 68f834a28..72d53cdeb 100644 --- a/ipnsfs/system.go +++ b/ipnsfs/system.go @@ -25,10 +25,10 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" 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" ) -var log = eventlog.Logger("ipnsfs") +var log = logging.Logger("ipnsfs") var ErrIsDirectory = errors.New("error: is a directory") @@ -236,7 +236,7 @@ func (kr *KeyRoot) Publish(ctx context.Context) error { kp := path.FromKey(k) - ev := &eventlog.Metadata{"name": kr.name, "key": kp} + ev := &logging.Metadata{"name": kr.name, "key": kp} defer log.EventBegin(ctx, "ipnsfsPublishing", ev).Done() log.Info("ipnsfs publishing %s -> %s", kr.name, kp) diff --git a/merkledag/merkledag.go b/merkledag/merkledag.go index 92fc00f92..4eae02290 100644 --- a/merkledag/merkledag.go +++ b/merkledag/merkledag.go @@ -9,10 +9,10 @@ import ( blocks "github.com/ipfs/go-ipfs/blocks" key "github.com/ipfs/go-ipfs/blocks/key" bserv "github.com/ipfs/go-ipfs/blockservice" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("merkledag") +var log = logging.Logger("merkledag") var ErrNotFound = fmt.Errorf("merkledag: not found") // DAGService is an IPFS Merkle DAG service. diff --git a/namesys/routing.go b/namesys/routing.go index 9ff2a62f6..9946ed560 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -11,10 +11,10 @@ import ( pb "github.com/ipfs/go-ipfs/namesys/pb" path "github.com/ipfs/go-ipfs/path" routing "github.com/ipfs/go-ipfs/routing" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("namesys") +var log = logging.Logger("namesys") // routingResolver implements NSResolver for the main IPFS SFS-like naming type routingResolver struct { diff --git a/p2p/crypto/key.go b/p2p/crypto/key.go index 3f7a27dc3..ec50774ed 100644 --- a/p2p/crypto/key.go +++ b/p2p/crypto/key.go @@ -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") diff --git a/p2p/crypto/secio/protocol.go b/p2p/crypto/secio/protocol.go index beb13d002..e8c8a42f4 100644 --- a/p2p/crypto/secio/protocol.go +++ b/p2p/crypto/secio/protocol.go @@ -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") diff --git a/p2p/discovery/mdns.go b/p2p/discovery/mdns.go index 62ab46fae..219d6b0cd 100644 --- a/p2p/discovery/mdns.go +++ b/p2p/discovery/mdns.go @@ -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" diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go index 85525b9c0..871d889e1 100644 --- a/p2p/host/basic/basic_host.go +++ b/p2p/host/basic/basic_host.go @@ -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 diff --git a/p2p/host/host.go b/p2p/host/host.go index 1e42f04d0..0d7e59d37 100644 --- a/p2p/host/host.go +++ b/p2p/host/host.go @@ -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 diff --git a/p2p/host/routed/routed.go b/p2p/host/routed/routed.go index ebb9cac1a..85a0e524a 100644 --- a/p2p/host/routed/routed.go +++ b/p2p/host/routed/routed.go @@ -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. diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index ba31108bc..a8bdb81be 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -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) diff --git a/p2p/net/conn/conn.go b/p2p/net/conn/conn.go index 8b6175159..0b50a7e96 100644 --- a/p2p/net/conn/conn.go +++ b/p2p/net/conn/conn.go @@ -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 diff --git a/p2p/net/mock/mock.go b/p2p/net/mock/mock.go index 611ef8e0a..906fe09b0 100644 --- a/p2p/net/mock/mock.go +++ b/p2p/net/mock/mock.go @@ -1,12 +1,12 @@ 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) { diff --git a/p2p/net/swarm/addr/addr.go b/p2p/net/swarm/addr/addr.go index 3a3d547d5..649d54b3c 100644 --- a/p2p/net/swarm/addr/addr.go +++ b/p2p/net/swarm/addr/addr.go @@ -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) diff --git a/p2p/net/swarm/swarm.go b/p2p/net/swarm/swarm.go index e919591ff..512369013 100644 --- a/p2p/net/swarm/swarm.go +++ b/p2p/net/swarm/swarm.go @@ -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 diff --git a/p2p/peer/peer.go b/p2p/peer/peer.go index 8c1d57429..4e1e3e3ab 100644 --- a/p2p/peer/peer.go +++ b/p2p/peer/peer.go @@ -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 diff --git a/p2p/peer/queue/sync.go b/p2p/peer/queue/sync.go index 6114c3158..04775a0f9 100644 --- a/p2p/peer/queue/sync.go +++ b/p2p/peer/queue/sync.go @@ -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 { diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index 7c4fc0b73..a433d15b2 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -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" diff --git a/p2p/protocol/mux.go b/p2p/protocol/mux.go index 94afce2f1..e0063c090 100644 --- a/p2p/protocol/mux.go +++ b/p2p/protocol/mux.go @@ -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 diff --git a/p2p/protocol/ping/ping.go b/p2p/protocol/ping/ping.go index 6a4327d22..717df9d47 100644 --- a/p2p/protocol/ping/ping.go +++ b/p2p/protocol/ping/ping.go @@ -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 diff --git a/p2p/protocol/relay/relay.go b/p2p/protocol/relay/relay.go index a2177c56c..673fdde2f 100644 --- a/p2p/protocol/relay/relay.go +++ b/p2p/protocol/relay/relay.go @@ -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" diff --git a/p2p/protocol/relay/relay_test.go b/p2p/protocol/relay/relay_test.go index 9c6b652af..d0178afb9 100644 --- a/p2p/protocol/relay/relay_test.go +++ b/p2p/protocol/relay/relay_test.go @@ -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) { diff --git a/p2p/test/backpressure/backpressure_test.go b/p2p/test/backpressure/backpressure_test.go index 77975567e..cf855eae5 100644 --- a/p2p/test/backpressure/backpressure_test.go +++ b/p2p/test/backpressure/backpressure_test.go @@ -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 diff --git a/p2p/test/reconnects/reconnect_test.go b/p2p/test/reconnects/reconnect_test.go index ee9275307..bdb8ccef9 100644 --- a/p2p/test/reconnects/reconnect_test.go +++ b/p2p/test/reconnects/reconnect_test.go @@ -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() diff --git a/p2p/test/util/key.go b/p2p/test/util/key.go index 2be7a3356..1196dfe01 100644 --- a/p2p/test/util/key.go +++ b/p2p/test/util/key.go @@ -5,7 +5,7 @@ import ( "io" "testing" - 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" testutil "github.com/ipfs/go-ipfs/util/testutil" @@ -15,7 +15,7 @@ import ( ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" ) -var log = eventlog.Logger("boguskey") +var log = logging.Logger("boguskey") // TestBogusPrivateKey is a key used for testing (to avoid expensive keygen) type TestBogusPrivateKey []byte diff --git a/package.json b/package.json index 8556bf77c..0aa5acc1a 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,11 @@ { "name": "dir-index-html", "hash": "QmdDfkqDWheE4gsCXNrhixwTwSHnZMPT2cGLcNbiBNcMyU" + }, + { + "name": "go-log", + "hash": "QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8", + "linkname": "go-log-v1.0.0" } ] } \ No newline at end of file diff --git a/path/resolver.go b/path/resolver.go index 275d2b7d4..6c3ae8a97 100644 --- a/path/resolver.go +++ b/path/resolver.go @@ -11,10 +11,10 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" merkledag "github.com/ipfs/go-ipfs/merkledag" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("path") +var log = logging.Logger("path") // Paths after a protocol must contain at least one component var ErrNoComponents = errors.New( diff --git a/pin/pin.go b/pin/pin.go index 3d51b7a06..a82b93f82 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -14,10 +14,10 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" "github.com/ipfs/go-ipfs/blocks/set" mdag "github.com/ipfs/go-ipfs/merkledag" - "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = util.Logger("pin") +var log = logging.Logger("pin") var recursePinDatastoreKey = ds.NewKey("/local/pins/recursive/keys") var directPinDatastoreKey = ds.NewKey("/local/pins/direct/keys") var indirectPinDatastoreKey = ds.NewKey("/local/pins/indirect/keys") diff --git a/repo/config/config.go b/repo/config/config.go index 42b56550c..77573e914 100644 --- a/repo/config/config.go +++ b/repo/config/config.go @@ -10,9 +10,10 @@ import ( "strings" u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("config") +var log = logging.Logger("config") // Config is used to load IPFS config files. type Config struct { diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 501580cf6..c9f9170c0 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -23,10 +23,10 @@ import ( mfsr "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" serialize "github.com/ipfs/go-ipfs/repo/fsrepo/serialize" dir "github.com/ipfs/go-ipfs/thirdparty/dir" - "github.com/ipfs/go-ipfs/thirdparty/eventlog" u "github.com/ipfs/go-ipfs/util" util "github.com/ipfs/go-ipfs/util" ds2 "github.com/ipfs/go-ipfs/util/datastore2" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) // version number that we are currently expecting to see @@ -406,9 +406,9 @@ func (r *FSRepo) openDatastore() error { } func configureEventLoggerAtRepoPath(c *config.Config, repoPath string) { - eventlog.Configure(eventlog.LevelInfo) - eventlog.Configure(eventlog.LdJSONFormatter) - eventlog.Configure(eventlog.Output(eventlog.WriterGroup)) + logging.Configure(logging.LevelInfo) + logging.Configure(logging.LdJSONFormatter) + logging.Configure(logging.Output(logging.WriterGroup)) } // Close closes the FSRepo, releasing held resources. @@ -436,7 +436,7 @@ func (r *FSRepo) Close() error { // // TODO It isn't part of the current contract, but callers may like for us // to disable logging once the component is closed. - // eventlog.Configure(eventlog.Output(os.Stderr)) + // logging.Configure(logging.Output(os.Stderr)) r.closed = true if err := r.lockfile.Close(); err != nil { diff --git a/repo/fsrepo/serialize/serialize.go b/repo/fsrepo/serialize/serialize.go index 2d87b8f6f..0bda04b46 100644 --- a/repo/fsrepo/serialize/serialize.go +++ b/repo/fsrepo/serialize/serialize.go @@ -11,9 +11,10 @@ import ( "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/facebookgo/atomicfile" "github.com/ipfs/go-ipfs/repo/config" "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = util.Logger("fsrepo") +var log = logging.Logger("fsrepo") // ReadConfigFile reads the config from `filename` into `cfg`. func ReadConfigFile(filename string, cfg interface{}) error { diff --git a/routing/dht/dht.go b/routing/dht/dht.go index 50c4df14c..b5d6d1611 100644 --- a/routing/dht/dht.go +++ b/routing/dht/dht.go @@ -18,8 +18,8 @@ import ( pb "github.com/ipfs/go-ipfs/routing/dht/pb" kb "github.com/ipfs/go-ipfs/routing/kbucket" record "github.com/ipfs/go-ipfs/routing/record" - "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" proto "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/proto" ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore" @@ -28,7 +28,7 @@ import ( context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" ) -var log = eventlog.Logger("dht") +var log = logging.Logger("dht") var ProtocolDHT protocol.ID = "/ipfs/dht" @@ -98,7 +98,7 @@ func (dht *IpfsDHT) LocalPeer() peer.ID { } // log returns the dht's logger -func (dht *IpfsDHT) log() eventlog.EventLogger { +func (dht *IpfsDHT) log() logging.EventLogger { return log // TODO rm } diff --git a/routing/dht/pb/message.go b/routing/dht/pb/message.go index 24ad1d6f0..d9f6a2073 100644 --- a/routing/dht/pb/message.go +++ b/routing/dht/pb/message.go @@ -6,10 +6,10 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" 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" ) -var log = eventlog.Logger("dht.pb") +var log = logging.Logger("dht.pb") type PeerRoutingInfo struct { peer.PeerInfo diff --git a/routing/dht/query.go b/routing/dht/query.go index 9906e5189..ab4f28492 100644 --- a/routing/dht/query.go +++ b/routing/dht/query.go @@ -8,10 +8,10 @@ import ( peer "github.com/ipfs/go-ipfs/p2p/peer" queue "github.com/ipfs/go-ipfs/p2p/peer/queue" "github.com/ipfs/go-ipfs/routing" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" u "github.com/ipfs/go-ipfs/util" pset "github.com/ipfs/go-ipfs/util/peerset" todoctr "github.com/ipfs/go-ipfs/util/todocounter" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" process "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess" ctxproc "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context" @@ -77,7 +77,7 @@ type dhtQueryRunner struct { errs u.MultiErr // result errors. maybe should be a map[peer.ID]error rateLimit chan struct{} // processing semaphore - log eventlog.EventLogger + log logging.EventLogger proc process.Process sync.RWMutex diff --git a/routing/kbucket/table.go b/routing/kbucket/table.go index 87d9c9e3f..45e438635 100644 --- a/routing/kbucket/table.go +++ b/routing/kbucket/table.go @@ -8,10 +8,10 @@ import ( "time" peer "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("table") +var log = logging.Logger("table") // RoutingTable defines the routing table. type RoutingTable struct { diff --git a/routing/mock/centralized_client.go b/routing/mock/centralized_client.go index 6085b69be..9d577c4a3 100644 --- a/routing/mock/centralized_client.go +++ b/routing/mock/centralized_client.go @@ -10,11 +10,11 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" peer "github.com/ipfs/go-ipfs/p2p/peer" routing "github.com/ipfs/go-ipfs/routing" - u "github.com/ipfs/go-ipfs/util" "github.com/ipfs/go-ipfs/util/testutil" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("mockrouter") +var log = logging.Logger("mockrouter") type client struct { datastore ds.Datastore diff --git a/routing/none/none_client.go b/routing/none/none_client.go index ce50d7357..8400e6a3b 100644 --- a/routing/none/none_client.go +++ b/routing/none/none_client.go @@ -9,10 +9,10 @@ import ( p2phost "github.com/ipfs/go-ipfs/p2p/host" peer "github.com/ipfs/go-ipfs/p2p/peer" routing "github.com/ipfs/go-ipfs/routing" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("mockrouter") +var log = logging.Logger("mockrouter") type nilclient struct { } diff --git a/routing/offline/offline.go b/routing/offline/offline.go index 2ef4e5633..7ead5d305 100644 --- a/routing/offline/offline.go +++ b/routing/offline/offline.go @@ -13,10 +13,10 @@ import ( routing "github.com/ipfs/go-ipfs/routing" pb "github.com/ipfs/go-ipfs/routing/dht/pb" record "github.com/ipfs/go-ipfs/routing/record" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("offlinerouting") +var log = logging.Logger("offlinerouting") var ErrOffline = errors.New("routing system in offline mode") diff --git a/routing/record/record.go b/routing/record/record.go index 8db5758e0..80da08581 100644 --- a/routing/record/record.go +++ b/routing/record/record.go @@ -9,11 +9,11 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" ci "github.com/ipfs/go-ipfs/p2p/crypto" pb "github.com/ipfs/go-ipfs/routing/dht/pb" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) var _ = dag.FetchGraph -var log = eventlog.Logger("routing/record") +var log = logging.Logger("routing/record") // MakePutRecord creates and signs a dht record for the given key/value pair func MakePutRecord(sk ci.PrivKey, key key.Key, value []byte, sign bool) (*pb.Record, error) { diff --git a/routing/supernode/client.go b/routing/supernode/client.go index 5269be51b..97d3d70c7 100644 --- a/routing/supernode/client.go +++ b/routing/supernode/client.go @@ -14,10 +14,10 @@ import ( routing "github.com/ipfs/go-ipfs/routing" pb "github.com/ipfs/go-ipfs/routing/dht/pb" proxy "github.com/ipfs/go-ipfs/routing/supernode/proxy" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = eventlog.Logger("supernode") +var log = logging.Logger("supernode") type Client struct { peerhost host.Host @@ -37,7 +37,7 @@ func NewClient(px proxy.Proxy, h host.Host, ps peer.Peerstore, local peer.ID) (* } func (c *Client) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan peer.PeerInfo { - ctx = eventlog.ContextWithLoggable(ctx, eventlog.Uuid("findProviders")) + ctx = logging.ContextWithLoggable(ctx, logging.Uuid("findProviders")) defer log.EventBegin(ctx, "findProviders", &k).Done() ch := make(chan peer.PeerInfo) go func() { diff --git a/routing/supernode/proxy/standard.go b/routing/supernode/proxy/standard.go index fe723409e..cba08c2ea 100644 --- a/routing/supernode/proxy/standard.go +++ b/routing/supernode/proxy/standard.go @@ -12,12 +12,12 @@ import ( peer "github.com/ipfs/go-ipfs/p2p/peer" dhtpb "github.com/ipfs/go-ipfs/routing/dht/pb" kbucket "github.com/ipfs/go-ipfs/routing/kbucket" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) const ProtocolSNR = "/ipfs/supernoderouting" -var log = eventlog.Logger("supernode/proxy") +var log = logging.Logger("supernode/proxy") type Proxy interface { Bootstrap(context.Context) error @@ -127,7 +127,7 @@ func (px *standard) SendRequest(ctx context.Context, m *dhtpb.Message) (*dhtpb.M } func (px *standard) sendRequest(ctx context.Context, m *dhtpb.Message, remote peer.ID) (*dhtpb.Message, error) { - e := log.EventBegin(ctx, "sendRoutingRequest", px.Host.ID(), remote, eventlog.Pair("request", m)) + e := log.EventBegin(ctx, "sendRoutingRequest", px.Host.ID(), remote, logging.Pair("request", m)) defer e.Done() if err := px.Host.Connect(ctx, peer.PeerInfo{ID: remote}); err != nil { e.SetError(err) @@ -157,8 +157,8 @@ func (px *standard) sendRequest(ctx context.Context, m *dhtpb.Message, remote pe e.SetError(err) return nil, err } - e.Append(eventlog.Pair("response", response)) - e.Append(eventlog.Pair("uuid", eventlog.Uuid("foo"))) + e.Append(logging.Pair("response", response)) + e.Append(logging.Pair("uuid", logging.Uuid("foo"))) return response, nil } diff --git a/tar/format.go b/tar/format.go index 0aac6a870..dee397d1b 100644 --- a/tar/format.go +++ b/tar/format.go @@ -13,12 +13,12 @@ import ( dag "github.com/ipfs/go-ipfs/merkledag" dagutil "github.com/ipfs/go-ipfs/merkledag/utils" uio "github.com/ipfs/go-ipfs/unixfs/io" - u "github.com/ipfs/go-ipfs/util" + 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 = u.Logger("tarfmt") +var log = logging.Logger("tarfmt") var blockSize = 512 var zeroBlock = make([]byte, blockSize) diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index bd6d964fe..380b66a17 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -18,12 +18,12 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" mocknet "github.com/ipfs/go-ipfs/p2p/net/mock" "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" "github.com/ipfs/go-ipfs/thirdparty/unit" testutil "github.com/ipfs/go-ipfs/util/testutil" ) -var log = eventlog.Logger("epictest") +var log = logging.Logger("epictest") const kSeed = 1 diff --git a/test/supernode_client/main.go b/test/supernode_client/main.go index 92f4c9445..ddd79f12f 100644 --- a/test/supernode_client/main.go +++ b/test/supernode_client/main.go @@ -28,12 +28,12 @@ import ( "github.com/ipfs/go-ipfs/repo" config "github.com/ipfs/go-ipfs/repo/config" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog" unit "github.com/ipfs/go-ipfs/thirdparty/unit" ds2 "github.com/ipfs/go-ipfs/util/datastore2" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var elog = eventlog.Logger("gc-client") +var elog = logging.Logger("gc-client") var ( cat = flag.Bool("cat", false, "else add") @@ -193,7 +193,7 @@ func runFileCattingWorker(ctx context.Context, n *core.IpfsNode) error { if err != nil { log.Fatal(err) } - e := elog.EventBegin(ctx, "cat", eventlog.LoggableF(func() map[string]interface{} { + e := elog.EventBegin(ctx, "cat", logging.LoggableF(func() map[string]interface{} { return map[string]interface{}{ "key": k, "localPeer": n.Identity, diff --git a/tour/tour.go b/tour/tour.go index cb33d7a0e..e84c77536 100644 --- a/tour/tour.go +++ b/tour/tour.go @@ -4,10 +4,10 @@ import ( "strconv" "strings" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) -var log = u.Logger("tour") +var log = logging.Logger("tour") // ID is a string identifier for topics type ID string diff --git a/unixfs/mod/dagmodifier.go b/unixfs/mod/dagmodifier.go index 8d97bddfc..c39714398 100644 --- a/unixfs/mod/dagmodifier.go +++ b/unixfs/mod/dagmodifier.go @@ -19,7 +19,7 @@ import ( pin "github.com/ipfs/go-ipfs/pin" ft "github.com/ipfs/go-ipfs/unixfs" uio "github.com/ipfs/go-ipfs/unixfs/io" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" ) var ErrSeekFail = errors.New("failed to seek properly") @@ -29,7 +29,7 @@ var ErrUnrecognizedWhence = errors.New("unrecognized whence") // 2MB var writebufferSize = 1 << 21 -var log = u.Logger("dagio") +var log = logging.Logger("dagio") // DagModifier is the only struct licensed and able to correctly // perform surgery on a DAG 'file' diff --git a/updates/updates.go b/updates/updates.go index 9a87375bb..73fde4c0f 100644 --- a/updates/updates.go +++ b/updates/updates.go @@ -8,7 +8,7 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - u "github.com/ipfs/go-ipfs/util" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" semver "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/coreos/go-semver/semver" update "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/inconshreveable/go-update" @@ -79,7 +79,7 @@ AAb7RaEDNJOa7qvUFecB ) -var log = u.Logger("updates") +var log = logging.Logger("updates") var currentVersion *semver.Version diff --git a/util/eventlog/loggables/loggables.go b/util/eventlog/loggables/loggables.go index 8e5f16423..9847d3c88 100644 --- a/util/eventlog/loggables/loggables.go +++ b/util/eventlog/loggables/loggables.go @@ -11,22 +11,22 @@ import ( ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" - log "github.com/ipfs/go-ipfs/thirdparty/eventlog" + logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0" peer "github.com/ipfs/go-ipfs/p2p/peer" ) // NetConn returns an eventlog.Metadata with the conn addresses -func NetConn(c net.Conn) log.Loggable { - return log.Metadata{ +func NetConn(c net.Conn) logging.Loggable { + return logging.Metadata{ "localAddr": c.LocalAddr(), "remoteAddr": c.RemoteAddr(), } } // Error returns an eventlog.Metadata with an error -func Error(e error) log.Loggable { - return log.Metadata{ +func Error(e error) logging.Loggable { + return logging.Metadata{ "error": e.Error(), } } diff --git a/util/ipfsaddr/ipfsaddr.go b/util/ipfsaddr/ipfsaddr.go index 04ac40629..edb9d5757 100644 --- a/util/ipfsaddr/ipfsaddr.go +++ b/util/ipfsaddr/ipfsaddr.go @@ -7,10 +7,10 @@ import ( ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" 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("ipfsaddr") +var log = logging.Logger("ipfsaddr") // ErrInvalidAddr signals an address is not a valid ipfs address. var ErrInvalidAddr = errors.New("invalid ipfs address") diff --git a/util/util.go b/util/util.go index d0fee9d42..bbeaff036 100644 --- a/util/util.go +++ b/util/util.go @@ -35,9 +35,6 @@ var ErrSearchIncomplete = errors.New("Error: Search Incomplete.") // ErrNotFound is returned when a search fails to find anything var ErrNotFound = ds.ErrNotFound -// ErrNoSuchLogger is returned when the util pkg is asked for a non existant logger -var ErrNoSuchLogger = errors.New("Error: No such logger") - // TildeExpansion expands a filename, which may begin with a tilde. func TildeExpansion(filename string) (string, error) { return homedir.Expand(filename) diff --git a/thirdparty/eventlog/context.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/context.go similarity index 98% rename from thirdparty/eventlog/context.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/context.go index f7e766147..0468047e4 100644 --- a/thirdparty/eventlog/context.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/context.go @@ -1,4 +1,4 @@ -package eventlog +package log import ( "errors" diff --git a/thirdparty/eventlog/context_test.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/context_test.go similarity index 97% rename from thirdparty/eventlog/context_test.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/context_test.go index b7494cec4..699a2edc2 100644 --- a/thirdparty/eventlog/context_test.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/context_test.go @@ -1,4 +1,4 @@ -package eventlog +package log import ( "testing" diff --git a/thirdparty/eventlog/entry.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/entry.go similarity index 98% rename from thirdparty/eventlog/entry.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/entry.go index 11ea994aa..f1e8d3f0e 100644 --- a/thirdparty/eventlog/entry.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/entry.go @@ -1,4 +1,4 @@ -package eventlog +package log import ( "time" diff --git a/thirdparty/eventlog/example_test.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/example_test.go similarity index 95% rename from thirdparty/eventlog/example_test.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/example_test.go index 65d6c09c9..f28e90b96 100644 --- a/thirdparty/eventlog/example_test.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/example_test.go @@ -1,4 +1,4 @@ -package eventlog +package log import "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" diff --git a/thirdparty/eventlog/log.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/log.go similarity index 93% rename from thirdparty/eventlog/log.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/log.go index 298350aae..563f1b7a9 100644 --- a/thirdparty/eventlog/log.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/log.go @@ -1,11 +1,10 @@ -package eventlog +package log import ( "fmt" "time" context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" - "github.com/ipfs/go-ipfs/util" // TODO remove IPFS dependency ) // StandardLogger provides API compatibility with standard printf loggers @@ -53,7 +52,16 @@ func Logger(system string) EventLogger { // TODO if we would like to adjust log levels at run-time. Store this event // logger in a map (just like the util.Logger impl) - return &eventLogger{system: system, StandardLogger: util.Logger(system)} + if len(system) == 0 { + log.Warnf("Missing name parameter") + system = "undefined" + } + if _, ok := loggers[system]; !ok { + loggers[system] = log.WithField("module", system) + } + logger := loggers[system] + + return &eventLogger{system: system, StandardLogger: logger} } // eventLogger implements the EventLogger and wraps a go-logging Logger diff --git a/thirdparty/eventlog/loggable.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/loggable.go similarity index 97% rename from thirdparty/eventlog/loggable.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/loggable.go index 27ffd8048..d770ebaf0 100644 --- a/thirdparty/eventlog/loggable.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/loggable.go @@ -1,4 +1,4 @@ -package eventlog +package log // Loggable describes objects that can be marshalled into Metadata for logging type Loggable interface { diff --git a/thirdparty/eventlog/metadata.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/metadata.go similarity index 99% rename from thirdparty/eventlog/metadata.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/metadata.go index b413a7daa..26164f7ef 100644 --- a/thirdparty/eventlog/metadata.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/metadata.go @@ -1,4 +1,4 @@ -package eventlog +package log import ( "encoding/json" diff --git a/thirdparty/eventlog/metadata_test.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/metadata_test.go similarity index 97% rename from thirdparty/eventlog/metadata_test.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/metadata_test.go index 5c25320e3..c1814511c 100644 --- a/thirdparty/eventlog/metadata_test.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/metadata_test.go @@ -1,4 +1,4 @@ -package eventlog +package log import "testing" diff --git a/util/log.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/oldlog.go similarity index 85% rename from util/log.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/oldlog.go index 68f110e34..4a8c3eb86 100644 --- a/util/log.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/oldlog.go @@ -1,6 +1,7 @@ -package util +package log import ( + "errors" "os" "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/Sirupsen/logrus" @@ -27,6 +28,9 @@ const ( envLoggingFmt = "IPFS_LOGGING_FMT" ) +// ErrNoSuchLogger is returned when the util pkg is asked for a non existant logger +var ErrNoSuchLogger = errors.New("Error: No such logger") + // loggers is the set of loggers in the system var loggers = map[string]*logrus.Entry{} @@ -52,10 +56,6 @@ func SetupLogging() { } } - if Debug := GetenvBool("IPFS_DEBUG"); Debug { - lvl = logrus.DebugLevel - } - SetAllLoggers(lvl) } @@ -72,18 +72,6 @@ func SetAllLoggers(lvl logrus.Level) { } } -// Logger retrieves a particular logger -func Logger(name string) *logrus.Entry { - if len(name) == 0 { - log.Warnf("Missing name parameter") - name = "undefined" - } - if _, ok := loggers[name]; !ok { - loggers[name] = log.WithField("module", name) - } - return loggers[name] -} - // SetLogLevel changes the log level of a specific subsystem // name=="*" changes all subsystems func SetLogLevel(name, level string) error { diff --git a/thirdparty/eventlog/option.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/option.go similarity index 98% rename from thirdparty/eventlog/option.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/option.go index 3fa77b61e..17750fd84 100644 --- a/thirdparty/eventlog/option.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/option.go @@ -1,4 +1,4 @@ -package eventlog +package log import ( "io" diff --git a/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/package.json b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/package.json new file mode 100644 index 000000000..8752f8d67 --- /dev/null +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/package.json @@ -0,0 +1,5 @@ +{ + "name": "go-log", + "version": "1.0.0", + "language": "go" +} \ No newline at end of file diff --git a/thirdparty/eventlog/polite_json_formatter.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/polite_json_formatter.go similarity index 96% rename from thirdparty/eventlog/polite_json_formatter.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/polite_json_formatter.go index 3e396ab84..be6638cfb 100644 --- a/thirdparty/eventlog/polite_json_formatter.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/polite_json_formatter.go @@ -1,4 +1,4 @@ -package eventlog +package log import ( "encoding/json" diff --git a/thirdparty/eventlog/writer.go b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/writer.go similarity index 98% rename from thirdparty/eventlog/writer.go rename to vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/writer.go index 9a7728a19..cfa48c9b3 100644 --- a/thirdparty/eventlog/writer.go +++ b/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log/writer.go @@ -1,4 +1,4 @@ -package eventlog +package log import ( "io" diff --git a/vendor/go-log-v1.0.0 b/vendor/go-log-v1.0.0 new file mode 120000 index 000000000..49efbf674 --- /dev/null +++ b/vendor/go-log-v1.0.0 @@ -0,0 +1 @@ +QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log \ No newline at end of file