提交 7ead6607 作者: Matt Bell 提交者: Juan Batiz-Benet

cmd/ipfs2: Set all loggers to DEBUG level when running with 'debug' flag

上级 520240d3
......@@ -6,6 +6,7 @@ import (
"os"
"runtime/pprof"
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"
......@@ -107,6 +108,8 @@ func handleOptions(req cmds.Request, root *cmds.Command) {
if debugBool, ok := debug.(bool); debugBool && ok {
u.Debug = true
u.SetAllLoggers(logging.DEBUG)
// if debugging, setup profiling.
if u.Debug {
ofi, err := os.Create("cpu.prof")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论