Changed debug flag to log-level in kpod/main.go

The change in flag from debug to log-level was causing cri-o to fail when started
There was a reference to the debug flag in kpod/main.go that had not been changed

Signed-off-by: umohnani8 <umohnani@redhat.com>
This commit is contained in:
umohnani8 2017-10-09 13:47:21 -04:00
parent bbd7321a7a
commit b4d3b560d3
3 changed files with 21 additions and 10 deletions

View file

@ -58,11 +58,21 @@ func main() {
waitCommand,
}
app.Before = func(c *cli.Context) error {
logrus.SetLevel(logrus.ErrorLevel)
if c.GlobalBool("debug") {
debug = true
logrus.SetLevel(logrus.DebugLevel)
logLevel := c.GlobalString("log-level")
if logLevel != "" {
level, err := logrus.ParseLevel(logLevel)
if err != nil {
return err
}
logrus.SetLevel(level)
}
if logLevel == "debug" {
debug = true
}
return nil
}
app.After = func(*cli.Context) error {
@ -80,9 +90,10 @@ func main() {
Name: "config, c",
Usage: "path of a config file detailing container server configuration options",
},
cli.BoolFlag{
Name: "debug",
Usage: "print debugging information",
cli.StringFlag{
Name: "log-level",
Usage: "log messages above specified level: debug, info, warn, error (default), fatal or panic",
Value: "error",
},
cli.StringFlag{
Name: "root",

View file

@ -438,9 +438,9 @@ _kpod_kpod() {
--runroot
--storage-driver
--storage-opt
--log-level
"
local boolean_options="
--debug
--help -h
--version -v
"

View file

@ -26,8 +26,8 @@ has the capability to debug pods/images created by crio.
**--config value, -c**=**"config.file"**
Path of a config file detailing container server configuration options
**--debug**
Print debugging information
**--log-level**
log messages above specified level: debug, info, warn, error (default), fatal or panic
**--root**=**value**
Path to the root directory in which data, including images, is stored