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:
parent
bbd7321a7a
commit
b4d3b560d3
3 changed files with 21 additions and 10 deletions
|
@ -58,11 +58,21 @@ func main() {
|
||||||
waitCommand,
|
waitCommand,
|
||||||
}
|
}
|
||||||
app.Before = func(c *cli.Context) error {
|
app.Before = func(c *cli.Context) error {
|
||||||
logrus.SetLevel(logrus.ErrorLevel)
|
logLevel := c.GlobalString("log-level")
|
||||||
if c.GlobalBool("debug") {
|
if logLevel != "" {
|
||||||
debug = true
|
level, err := logrus.ParseLevel(logLevel)
|
||||||
logrus.SetLevel(logrus.DebugLevel)
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logrus.SetLevel(level)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if logLevel == "debug" {
|
||||||
|
debug = true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
app.After = func(*cli.Context) error {
|
app.After = func(*cli.Context) error {
|
||||||
|
@ -80,9 +90,10 @@ func main() {
|
||||||
Name: "config, c",
|
Name: "config, c",
|
||||||
Usage: "path of a config file detailing container server configuration options",
|
Usage: "path of a config file detailing container server configuration options",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.StringFlag{
|
||||||
Name: "debug",
|
Name: "log-level",
|
||||||
Usage: "print debugging information",
|
Usage: "log messages above specified level: debug, info, warn, error (default), fatal or panic",
|
||||||
|
Value: "error",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "root",
|
Name: "root",
|
||||||
|
|
|
@ -438,9 +438,9 @@ _kpod_kpod() {
|
||||||
--runroot
|
--runroot
|
||||||
--storage-driver
|
--storage-driver
|
||||||
--storage-opt
|
--storage-opt
|
||||||
|
--log-level
|
||||||
"
|
"
|
||||||
local boolean_options="
|
local boolean_options="
|
||||||
--debug
|
|
||||||
--help -h
|
--help -h
|
||||||
--version -v
|
--version -v
|
||||||
"
|
"
|
||||||
|
|
|
@ -26,8 +26,8 @@ has the capability to debug pods/images created by crio.
|
||||||
**--config value, -c**=**"config.file"**
|
**--config value, -c**=**"config.file"**
|
||||||
Path of a config file detailing container server configuration options
|
Path of a config file detailing container server configuration options
|
||||||
|
|
||||||
**--debug**
|
**--log-level**
|
||||||
Print debugging information
|
log messages above specified level: debug, info, warn, error (default), fatal or panic
|
||||||
|
|
||||||
**--root**=**value**
|
**--root**=**value**
|
||||||
Path to the root directory in which data, including images, is stored
|
Path to the root directory in which data, including images, is stored
|
||||||
|
|
Loading…
Reference in a new issue