From f312575da40d7cd332c7300d09cde867af264402 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Sat, 29 Dec 2018 00:49:39 +0300 Subject: [PATCH] verbose output parameter --- app.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index 0bfb6e1b..89605843 100644 --- a/app.go +++ b/app.go @@ -3,7 +3,6 @@ package main import ( "bufio" "fmt" - "log" "net" "net/http" "os" @@ -14,6 +13,7 @@ import ( "time" "github.com/gobuffalo/packr" + log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh/terminal" ) @@ -62,6 +62,7 @@ func main() { } bindPort = &v }}, + {"verbose", "v", "enable verbose output", nil}, {"help", "h", "print this help", nil}, } printHelp := func() { @@ -79,6 +80,9 @@ func main() { printHelp() os.Exit(64) } + if v == "--verbose" || v == "-v" { + log.SetLevel(log.TraceLevel) + } knownParam := false for _, opt := range opts { if v == "--"+opt.longName {