mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-23 03:17:43 +08:00
initialize loggers at ERROR
This commit is contained in:
parent
02de522216
commit
7e1cd59259
@ -14,7 +14,7 @@ import (
|
||||
u "github.com/jbenet/go-ipfs/util"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("blockservice")
|
||||
var log = u.Logger("blockservice", logging.ERROR)
|
||||
|
||||
// BlockService is a block datastore.
|
||||
// It uses an internal `datastore.Datastore` instance to store values.
|
||||
|
||||
@ -62,7 +62,7 @@ Use "ipfs help <command>" for more information about a command.
|
||||
}
|
||||
|
||||
// log is the command logger
|
||||
var log = logging.MustGetLogger("cmd/ipfs")
|
||||
var log = u.Logger("cmd/ipfs", logging.ERROR)
|
||||
|
||||
func init() {
|
||||
config, err := config.PathRoot()
|
||||
|
||||
@ -4,10 +4,11 @@ import (
|
||||
"io"
|
||||
|
||||
"github.com/jbenet/go-ipfs/core"
|
||||
u "github.com/jbenet/go-ipfs/util"
|
||||
|
||||
logging "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("commands")
|
||||
var log = u.Logger("commands", logging.ERROR)
|
||||
|
||||
type CmdFunc func(*core.IpfsNode, []string, map[string]interface{}, io.Writer) error
|
||||
|
||||
@ -28,7 +28,7 @@ import (
|
||||
u "github.com/jbenet/go-ipfs/util"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("core")
|
||||
var log = u.Logger("core", logging.ERROR)
|
||||
|
||||
// IpfsNode is IPFS Core module. It represents an IPFS instance.
|
||||
type IpfsNode struct {
|
||||
|
||||
@ -18,7 +18,7 @@ import (
|
||||
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("daemon")
|
||||
var log = u.Logger("daemon", logging.ERROR)
|
||||
|
||||
// LockFile is the filename of the daemon lock, relative to config dir
|
||||
const LockFile = "daemon.lock"
|
||||
|
||||
@ -20,7 +20,7 @@ import (
|
||||
u "github.com/jbenet/go-ipfs/util"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("ipns")
|
||||
var log = u.Logger("ipns", logging.ERROR)
|
||||
|
||||
// FileSystem is the readwrite IPNS Fuse Filesystem.
|
||||
type FileSystem struct {
|
||||
|
||||
@ -24,7 +24,7 @@ import (
|
||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("ipfs")
|
||||
var log = u.Logger("ipfs", logging.ERROR)
|
||||
|
||||
// FileSystem is the readonly Ipfs Fuse Filesystem.
|
||||
type FileSystem struct {
|
||||
|
||||
@ -12,7 +12,7 @@ import (
|
||||
u "github.com/jbenet/go-ipfs/util"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("merkledag")
|
||||
var log = u.Logger("merkledag", logging.ERROR)
|
||||
|
||||
// NodeMap maps u.Keys to Nodes.
|
||||
// We cannot use []byte/Multihash for keys :(
|
||||
|
||||
@ -14,7 +14,7 @@ import (
|
||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("namesys")
|
||||
var log = u.Logger("namesys", logging.ERROR)
|
||||
|
||||
// RoutingResolver implements NSResolver for the main IPFS SFS-like naming
|
||||
type RoutingResolver struct {
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("path")
|
||||
var log = u.Logger("path", logging.ERROR)
|
||||
|
||||
// Resolver provides path resolution to IPFS
|
||||
// It has a pointer to a DAGService, which is uses to resolve nodes.
|
||||
|
||||
@ -22,7 +22,7 @@ import (
|
||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
|
||||
)
|
||||
|
||||
var log = logging.MustGetLogger("dht")
|
||||
var log = u.Logger("dht", logging.ERROR)
|
||||
|
||||
// TODO. SEE https://github.com/jbenet/node-ipfs/blob/master/submodules/ipfs-dht/index.js
|
||||
|
||||
|
||||
@ -118,11 +118,16 @@ func SetupLogging() {
|
||||
logging.SetLevel(logging.ERROR, "")
|
||||
}
|
||||
*/
|
||||
logging.SetLevel(logging.ERROR, "merkledag")
|
||||
logging.SetLevel(logging.ERROR, "blockservice")
|
||||
logging.SetFormatter(logging.MustStringFormatter(LogFormat))
|
||||
}
|
||||
|
||||
// Logger retrieves a particular logger + initializes it at a particular level
|
||||
func Logger(name string, lvl logging.Level) *logging.Logger {
|
||||
log := logging.MustGetLogger(name)
|
||||
logging.SetLevel(lvl, name)
|
||||
return log
|
||||
}
|
||||
|
||||
// ExpandPathnames takes a set of paths and turns them into absolute paths
|
||||
func ExpandPathnames(paths []string) ([]string, error) {
|
||||
var out []string
|
||||
|
||||
Loading…
Reference in New Issue
Block a user