Improve logging#179
Conversation
|
Maybe we should add the different log levels to the help? |
cmd/ipfs/ipfs.go
Outdated
There was a problem hiding this comment.
this is a case where we do want fmt.Fprintf(os.Stderr, ..., because this should be output cleanly to the user in the cli (the logger has a complicated format, and may be redirected later on).
Think about this like git or other tools. normal errors part of the use of the application should usually result in the user getting a simple error message. The logger is to signal what's going on under the hood, a logger.Error is closer to an unexpected problem.
cmd/ipfs/log.go
Outdated
There was a problem hiding this comment.
UsageLine: "log <name> <level> ",
Short: "switch logging levels of a running daemon",
Long: `ipfs log <name> <level> - switch logging levels of a running daemon
<name> is a the subsystem logging identifier. Use * for all subsystems.
<level> is one of: debug, info, notice, warning, error, critical
ipfs log is a utility command used to change the logging output of a running daemon.
`
util/log.go
Outdated
There was a problem hiding this comment.
Was there a bug with how the logic was before (setting lvl := logging.ERROR, and changing it if the env var, etc) ? That way SetAllLoggers is only called once.
|
Ok, just a couple things to address, and this LGTM! |
|
Addressed :] |
|
@jbenet where do you get all these gifs from? I image you have a TB hard drive full of gifs sorted in some specific way, and maybe a helper program you can type keywords into and have it spit back a gif. Ill bet that was the motivation for IPFS, you didnt have enough local hard drive space for your gifs, so you needed a clever way to trick other people into storing them for you... very smart 👍 |
|
:D That would make for an awesome example app when the alpha is ready. |

This implements parts of #152.
Mainly the
IPFS_DEBUGflag and theipfs logcommand to change log levels of a running daemon. I chose add a explicitGetEnvBool()to theutilpkg.