(t *testing.T)
| 1022 | } |
| 1023 | |
| 1024 | func TestNopLogger(t *testing.T) { |
| 1025 | logger := NewNop() |
| 1026 | |
| 1027 | t.Run("basic levels", func(t *testing.T) { |
| 1028 | logger.Debug("foo", String("k", "v")) |
| 1029 | logger.Info("bar", Int("x", 42)) |
| 1030 | logger.Warn("baz", Strings("ks", []string{"a", "b"})) |
| 1031 | logger.Error("qux", Error(errors.New("great sadness"))) |
| 1032 | }) |
| 1033 | |
| 1034 | t.Run("DPanic", func(t *testing.T) { |
| 1035 | logger.With(String("component", "whatever")).DPanic("stuff") |
| 1036 | }) |
| 1037 | |
| 1038 | t.Run("Panic", func(t *testing.T) { |
| 1039 | assert.Panics(t, func() { |
| 1040 | logger.Panic("great sadness") |
| 1041 | }, "Nop logger should still cause panics.") |
| 1042 | }) |
| 1043 | } |
| 1044 | |
| 1045 | func TestMust(t *testing.T) { |
| 1046 | t.Run("must without an error does not panic", func(t *testing.T) { |
nothing calls this directly
no test coverage detected