MCPcopy
hub / github.com/sirupsen/logrus / TestUserSuppliedFieldDoesNotOverwriteDefaults

Function TestUserSuppliedFieldDoesNotOverwriteDefaults

logrus_test.go:223–229  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

221}
222
223func TestUserSuppliedFieldDoesNotOverwriteDefaults(t *testing.T) {
224 LogAndAssertJSON(t, func(log *Logger) {
225 log.WithField("msg", "hello").Info("test")
226 }, func(fields Fields) {
227 assert.Equal(t, "test", fields["msg"])
228 })
229}
230
231func TestUserSuppliedMsgFieldHasPrefix(t *testing.T) {
232 LogAndAssertJSON(t, func(log *Logger) {

Callers

nothing calls this directly

Calls 3

LogAndAssertJSONFunction · 0.85
InfoMethod · 0.65
WithFieldMethod · 0.65

Tested by

no test coverage detected