(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func TestBatchHandlerSetLevel(t *testing.T) { |
| 92 | h := NewBatchHandler(BatchOptions{ |
| 93 | Level: slog.LevelWarn, |
| 94 | WriteFunc: func(ctx context.Context, logs []*Log) error { |
| 95 | return nil |
| 96 | }, |
| 97 | }) |
| 98 | |
| 99 | if h.options.Level != slog.LevelWarn { |
| 100 | t.Fatalf("Expected the initial level to be %d, got %d", slog.LevelWarn, h.options.Level) |
| 101 | } |
| 102 | |
| 103 | h.SetLevel(slog.LevelDebug) |
| 104 | |
| 105 | if h.options.Level != slog.LevelDebug { |
| 106 | t.Fatalf("Expected the updated level to be %d, got %d", slog.LevelDebug, h.options.Level) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func TestBatchHandlerWithAttrsAndWithGroup(t *testing.T) { |
| 111 | h0 := NewBatchHandler(BatchOptions{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…