diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index 34d9a24ff..fb0076e12 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -12,8 +12,6 @@ import ( "syscall" "time" - // TODO rm direct reference to go-logging - logging "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-logging" ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" manet "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net" @@ -147,7 +145,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.SetAllLoggers(logging.DEBUG) + u.SetDebugLogging() } // if debugging, let's profile. diff --git a/util/log.go b/util/log.go index 4200c15a8..083c2d5eb 100644 --- a/util/log.go +++ b/util/log.go @@ -70,6 +70,11 @@ func SetupLogging() { } +// SetDebugLogging calls SetAllLoggers with logging.DEBUG +func SetDebugLogging() { + SetAllLoggers(logging.DEBUG) +} + // SetAllLoggers changes the logging.Level of all loggers to lvl func SetAllLoggers(lvl logging.Level) { logging.SetLevel(lvl, "")