mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-20 10:42:11 +08:00
logging on gen
This commit is contained in:
@ -47,12 +47,11 @@ func makeCommand(cmdDesc command) commanderFunc {
|
||||
|
||||
err = daemon.SendCommand(cmd, confdir)
|
||||
if err != nil {
|
||||
fmt.Printf("Executing command locally: %s", err)
|
||||
log.Info("Executing command locally: %s", err)
|
||||
// Do locally
|
||||
n, err := localNode(confdir, cmdDesc.online)
|
||||
if err != nil {
|
||||
fmt.Println("Local node creation failed.")
|
||||
return err
|
||||
return fmt.Errorf("Local node creation failed: %v", err)
|
||||
}
|
||||
|
||||
return cmdDesc.cmdFn(n, cmd.Args, cmd.Opts, os.Stdout)
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
flag "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
|
||||
commander "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
|
||||
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
||||
logging "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
|
||||
|
||||
config "github.com/jbenet/go-ipfs/config"
|
||||
core "github.com/jbenet/go-ipfs/core"
|
||||
@ -61,6 +62,9 @@ Use "ipfs help <command>" for more information about a command.
|
||||
Flag: *flag.NewFlagSet("ipfs", flag.ExitOnError),
|
||||
}
|
||||
|
||||
// log is the command logger
|
||||
var log = logging.MustGetLogger("cmd/ipfs")
|
||||
|
||||
func init() {
|
||||
config, err := config.PathRoot()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user