Support --debug flag

Also adds better logging output
This commit is contained in:
Brian DeHamer 2015-07-22 21:58:16 +00:00
parent 3d0c853e42
commit bfed95ecaf
46 changed files with 3418 additions and 17 deletions

11
main.go
View file

@ -10,6 +10,7 @@ import (
"github.com/CenturyLinkLabs/watchtower/actions"
"github.com/CenturyLinkLabs/watchtower/container"
log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
)
@ -39,6 +40,10 @@ func main() {
Name: "no-pull",
Usage: "do not pull new images",
},
cli.BoolFlag{
Name: "debug",
Usage: "enable debug mode with verbose logging",
},
}
handleSignals()
@ -59,6 +64,12 @@ func handleSignals() {
}
func before(c *cli.Context) error {
if c.GlobalBool("debug") {
log.SetLevel(log.DebugLevel)
} else {
log.SetLevel(log.InfoLevel)
}
client := newContainerClient(c)
return actions.CheckPrereqs(client)
}