File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 77 "github.com/containers/storage"
88 "github.com/fatih/camelcase"
99 "github.com/kubernetes-incubator/cri-o/libkpod"
10- "github.com/sirupsen/logrus"
1110 "github.com/urfave/cli"
1211)
1312
@@ -50,9 +49,6 @@ func getConfig(c *cli.Context) (*libkpod.Config, error) {
5049 config .StorageOptions = opts
5150 }
5251 }
53- if c .Bool ("debug" ) {
54- logrus .SetLevel (logrus .DebugLevel )
55- }
5652 if c .GlobalIsSet ("runtime" ) {
5753 config .Runtime = c .GlobalString ("runtime" )
5854 }
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ func main() {
1515 if reexec .Init () {
1616 return
1717 }
18- logrus .SetLevel (logrus .ErrorLevel )
1918
2019 app := cli .NewApp ()
2120 app .Name = "kpod"
@@ -44,6 +43,13 @@ func main() {
4443 statsCommand ,
4544 loadCommand ,
4645 }
46+ app .Before = func (c * cli.Context ) error {
47+ logrus .SetLevel (logrus .ErrorLevel )
48+ if c .GlobalBool ("debug" ) {
49+ logrus .SetLevel (logrus .DebugLevel )
50+ }
51+ return nil
52+ }
4753 app .Flags = []cli.Flag {
4854 cli.StringFlag {
4955 Name : "config, c" ,
You can’t perform that action at this time.
0 commit comments