MCPcopy Create free account
hub / github.com/blues/note / debugEnv

Function debugEnv

lib/debug.go:94–109  ·  view source on GitHub ↗

Get the value of a boolean environment variable

(which string)

Source from the content-addressed store, hash-verified

92
93// Get the value of a boolean environment variable
94func debugEnv(which string) (isAvail bool, value bool) {
95 envvar := "DEBUG_" + strings.ToUpper(which)
96 env := os.Getenv(envvar)
97 if env == "" {
98 return false, false
99 }
100 i, err := strconv.Atoi(env)
101 if err != nil {
102 return true, false
103 }
104 if i == 0 {
105 return true, false
106 }
107 logInfo(context.Background(), "%s is ENABLED", envvar)
108 return true, true
109}
110
111// Log functions with printf-style args
112var debugLoggerFunc LogFunc

Callers 1

debugEnvInitFunction · 0.85

Calls 1

logInfoFunction · 0.85

Tested by

no test coverage detected