From 1654f776b55bbb861f72c0dd3118ad1beec5db31 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 3 Apr 2017 15:26:50 -0400 Subject: [PATCH] 11407: keepclient checks for ARVADOS_DEBUG and enables debugging. --- sdk/go/keepclient/support.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sdk/go/keepclient/support.go b/sdk/go/keepclient/support.go index 22447794f1..9adbb4878f 100644 --- a/sdk/go/keepclient/support.go +++ b/sdk/go/keepclient/support.go @@ -7,9 +7,12 @@ import ( "git.curoverse.com/arvados.git/sdk/go/streamer" "io" "io/ioutil" + "log" "math/rand" "net" "net/http" + "os" + "regexp" "strings" "time" ) @@ -19,6 +22,13 @@ import ( // log.Printf to DebugPrintf. var DebugPrintf = func(string, ...interface{}) {} +func init() { + var matchTrue = regexp.MustCompile("^(?i:1|yes|true)$") + if matchTrue.MatchString(os.Getenv("ARVADOS_DEBUG")) { + DebugPrintf = log.Printf + } +} + type keepService struct { Uuid string `json:"uuid"` Hostname string `json:"service_host"` -- 2.30.2