MCPcopy Index your code
hub / github.com/cloudfoundry/cli / LogLevel

Method LogLevel

util/configv3/env.go:111–133  ·  view source on GitHub ↗

LogLevel returns the global log level. The levels follow Logrus's log level scheme. This value is based off of: - The $CF_LOG_LEVEL and an int/warn/info/etc... - Defaults to PANIC/0 (ie no logging)

()

Source from the content-addressed store, hash-verified

109// - The $CF_LOG_LEVEL and an int/warn/info/etc...
110// - Defaults to PANIC/0 (ie no logging)
111func (config *Config) LogLevel() int {
112 if config.ENV.CFLogLevel != "" {
113 envVal, err := strconv.ParseInt(config.ENV.CFLogLevel, 10, 32)
114 if err == nil {
115 return int(envVal)
116 }
117
118 switch strings.ToLower(config.ENV.CFLogLevel) {
119 case "fatal":
120 return 1
121 case "error":
122 return 2
123 case "warn":
124 return 3
125 case "info":
126 return 4
127 case "debug":
128 return 5
129 }
130 }
131
132 return 0
133}
134
135// StagingTimeout returns the max time an application staging should take. The
136// time is based off of:

Callers 2

env_test.goFile · 0.80
executionWrapperMethod · 0.80

Implementers 1

FakeConfigcommand/commandfakes/fake_config.go

Calls

no outgoing calls

Tested by

no test coverage detected