1
0
mirror of https://github.com/moby/moby.git synced 2026-01-06 07:21:23 +03:00

Add --log-level support

Next steps, in another PR, would be:
- make all logging go through the logrus stuff
- I'd like to see if we can remove the env var stuff (like DEBUG) but we'll see

Closes #5198

Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
Doug Davis
2014-10-01 06:07:24 -07:00
parent 8682bac309
commit 2facc04673
10 changed files with 108 additions and 15 deletions

View File

@@ -6,11 +6,7 @@ import (
log "github.com/Sirupsen/logrus"
)
func initLogging(debug bool) {
func initLogging(lvl log.Level) {
log.SetOutput(os.Stderr)
if debug {
log.SetLevel(log.DebugLevel)
} else {
log.SetLevel(log.InfoLevel)
}
log.SetLevel(lvl)
}