@cryptotaxi247 / kubo / commits / ac2be0b68

util/log: SetDebugLogging

Juan Batiz-Benet committed Dec 11, 2014 at 01:52 UTC ac2be0b68b0129d57effdee6abae2618ffe150e8
2 files changed +6 -3
cmd/ipfs/main.go
+1 -3
@@ -12,8 +12,6 @@ import (
12 "syscall"
13 "time"
14
15 - // TODO rm direct reference to go-logging
16 - logging "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-logging"
15 ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
16 manet "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
17
@@ -147,7 +145,7 @@ func (i *cmdInvocation) Run(ctx context.Context) (output io.Reader, err error) {
145 }
146 if debug || u.GetenvBool("DEBUG") || os.Getenv("IPFS_LOGGING") == "debug" {
147 u.Debug = true
150 - u.SetAllLoggers(logging.DEBUG)
148 + u.SetDebugLogging()
149 }
150
151 // if debugging, let's profile.
util/log.go
+5
@@ -70,6 +70,11 @@ func SetupLogging() {
70
71 }
72
73 +// SetDebugLogging calls SetAllLoggers with logging.DEBUG
74 +func SetDebugLogging() {
75 + SetAllLoggers(logging.DEBUG)
76 +}
77 +
78 // SetAllLoggers changes the logging.Level of all loggers to lvl
79 func SetAllLoggers(lvl logging.Level) {
80 logging.SetLevel(lvl, "")