MCPcopy
hub / github.com/gofiber/fiber / Test_DefaultLogger

Function Test_DefaultLogger

log/default_test.go:165–187  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func Test_DefaultLogger(t *testing.T) {
166 initDefaultLogger()
167
168 var w byteSliceWriter
169 SetOutput(&w)
170
171 Trace("trace work")
172 Debug("received work order")
173 Info("starting work")
174 Warn("work may fail")
175 Error("work failed")
176
177 require.Panics(t, func() {
178 Panic("work panic")
179 })
180
181 require.Equal(t, "[Trace] trace work\n"+
182 "[Debug] received work order\n"+
183 "[Info] starting work\n"+
184 "[Warn] work may fail\n"+
185 "[Error] work failed\n"+
186 "[Panic] work panic\n", string(w.b))
187}
188
189func Test_DefaultFormatLogger(t *testing.T) {
190 initDefaultLogger()

Callers

nothing calls this directly

Calls 8

initDefaultLoggerFunction · 0.85
SetOutputFunction · 0.85
TraceFunction · 0.85
DebugFunction · 0.85
InfoFunction · 0.85
WarnFunction · 0.85
PanicFunction · 0.85
ErrorFunction · 0.70

Tested by

no test coverage detected