File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 44 "fmt"
55 _url "net/url"
66 "os"
7+ "strconv"
78 "strings"
89 "time"
910
@@ -16,6 +17,9 @@ import (
1617
1718const (
1819 BinaryName = "git-remote-https+iap"
20+
21+ // DebugEnvVariable is the name of the environment variable that needs to be set in order to enable debug logging
22+ DebugEnvVariable = "GIT_IAP_VERBOSE"
1923)
2024
2125var (
@@ -64,8 +68,11 @@ func init() {
6468 configureCmd .MarkFlagRequired ("clientID" )
6569 rootCmd .AddCommand (configureCmd )
6670
67- // set default log level
68- zerolog .SetGlobalLevel (zerolog .DebugLevel )
71+ // set log level
72+ zerolog .SetGlobalLevel (zerolog .ErrorLevel )
73+ if debug , _ := strconv .ParseBool (os .Getenv (DebugEnvVariable )); debug {
74+ zerolog .SetGlobalLevel (zerolog .DebugLevel )
75+ }
6976}
7077
7178func main () {
You can’t perform that action at this time.
0 commit comments