aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-02-11 18:39:52 +0100
committerSimon Ser <contact@emersion.fr>2020-02-11 18:39:52 +0100
commit13f541469198e29f9a16f54aeecf7b55cea629c8 (patch)
tree37e2e0af377f63545725acca8cddd0acfc05bf66 /cmd
parente59ad57e32289ef62e17a8361b6d36b77e56a25d (diff)
downloadalps-13f541469198e29f9a16f54aeecf7b55cea629c8.tar.gz
alps-13f541469198e29f9a16f54aeecf7b55cea629c8.zip
cmd/koushin: add -debug flag
Diffstat (limited to 'cmd')
-rw-r--r--cmd/koushin/main.go7
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() {