diff options
author | Simon Ser <contact@emersion.fr> | 2020-02-11 18:39:52 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-02-11 18:39:52 +0100 |
commit | 13f541469198e29f9a16f54aeecf7b55cea629c8 (patch) | |
tree | 37e2e0af377f63545725acca8cddd0acfc05bf66 /cmd | |
parent | e59ad57e32289ef62e17a8361b6d36b77e56a25d (diff) | |
download | alps-13f541469198e29f9a16f54aeecf7b55cea629c8.tar.gz alps-13f541469198e29f9a16f54aeecf7b55cea629c8.zip |
cmd/koushin: add -debug flag
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/koushin/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/koushin/main.go b/cmd/koushin/main.go index afdf7f3..392150f 100644 --- a/cmd/koushin/main.go +++ b/cmd/koushin/main.go @@ -23,9 +23,10 @@ func main() { var addr string flag.StringVar(&options.Theme, "theme", "", "default theme") flag.StringVar(&addr, "addr", ":1323", "listening address") + flag.BoolVar(&options.Debug, "debug", false, "enable debug logs") flag.Usage = func() { - fmt.Fprintf(flag.CommandLine.Output(), "usage: koushin [options...] <upstream server...>\n") + fmt.Fprintf(flag.CommandLine.Output(), "usage: koushin [options...] <upstream servers...>\n") flag.PrintDefaults() } @@ -48,6 +49,10 @@ func main() { } e.Use(middleware.Recover()) + if options.Debug { + e.Logger.SetLevel(log.DEBUG) + } + sigs := make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGUSR1) go func() { |