Commit 7bf7afb7 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

logging on gen

parent e91b2b8a
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment