debug flag
This commit is contained in:
parent
7a19cd3467
commit
11ebd96b9b
8
main.go
8
main.go
@ -13,12 +13,16 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
logrus.SetLevel(logrus.InfoLevel)
|
||||
|
||||
//Parse command line
|
||||
|
||||
p := params.Parse()
|
||||
|
||||
if p.Debug {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
} else {
|
||||
logrus.SetLevel(logrus.InfoLevel)
|
||||
}
|
||||
|
||||
if p.Help {
|
||||
params.PrintHelp()
|
||||
return
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
type ParamsType struct {
|
||||
Help bool
|
||||
Version bool
|
||||
Debug bool
|
||||
Dumpconfig bool
|
||||
}
|
||||
|
||||
@ -16,6 +17,7 @@ func Parse() ParamsType {
|
||||
flag.BoolVar(&(params.Help), "help", false, "Show help")
|
||||
flag.BoolVar(&(params.Version), "version", false, "Show version")
|
||||
flag.BoolVar(&(params.Dumpconfig), "dumpconfig", false, "dump mapserver.json and exit")
|
||||
flag.BoolVar(&(params.Debug), "debug", false, "enable debug log")
|
||||
flag.Parse()
|
||||
|
||||
return params
|
||||
|
Loading…
Reference in New Issue
Block a user