aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
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() {