MCPcopy
hub / github.com/etcd-io/etcd / etcdClientDebugLevel

Function etcdClientDebugLevel

client/v3/logger.go:49–60  ·  view source on GitHub ↗

etcdClientDebugLevel translates ETCD_CLIENT_DEBUG into zap log level.

()

Source from the content-addressed store, hash-verified

47
48// etcdClientDebugLevel translates ETCD_CLIENT_DEBUG into zap log level.
49func etcdClientDebugLevel() zapcore.Level {
50 envLevel := os.Getenv("ETCD_CLIENT_DEBUG")
51 if envLevel == "" || envLevel == "true" {
52 return zapcore.InfoLevel
53 }
54 var l zapcore.Level
55 if err := l.Set(envLevel); err != nil {
56 log.Print("Invalid value for environment variable 'ETCD_CLIENT_DEBUG'. Using default level: 'info'")
57 return zapcore.InfoLevel
58 }
59 return l
60}

Callers 2

initFunction · 0.85
newClientFunction · 0.85

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…