MCPcopy
hub / github.com/rs/zerolog / String

Method String

log.go:152–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150)
151
152func (l Level) String() string {
153 switch l {
154 case TraceLevel:
155 return LevelTraceValue
156 case DebugLevel:
157 return LevelDebugValue
158 case InfoLevel:
159 return LevelInfoValue
160 case WarnLevel:
161 return LevelWarnValue
162 case ErrorLevel:
163 return LevelErrorValue
164 case FatalLevel:
165 return LevelFatalValue
166 case PanicLevel:
167 return LevelPanicValue
168 case Disabled:
169 return "disabled"
170 case NoLevel:
171 return ""
172 }
173 return strconv.Itoa(int(l))
174}
175
176// ParseLevel converts a level string into a zerolog Level value.
177// returns an error if the input string does not match known values.

Callers 15

RunMethod · 0.45
TestFatalDisabledFunction · 0.45
TestPanicDisabledFunction · 0.45
TestLevel_StringFunction · 0.45
hook_test.goFile · 0.45
RunMethod · 0.45
TestEvent_AnErrFunction · 0.45
TestEvent_ObjectFunction · 0.45
TestEvent_MsgFuncFunction · 0.45

Calls

no outgoing calls

Tested by 15

RunMethod · 0.36
TestFatalDisabledFunction · 0.36
TestPanicDisabledFunction · 0.36
TestLevel_StringFunction · 0.36
RunMethod · 0.36
TestEvent_AnErrFunction · 0.36
TestEvent_ObjectFunction · 0.36
TestEvent_MsgFuncFunction · 0.36