MCPcopy
hub / github.com/pocketbase/pocketbase / TestBatchHandlerSetLevel

Function TestBatchHandlerSetLevel

tools/logger/batch_handler_test.go:91–108  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func 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
110func TestBatchHandlerWithAttrsAndWithGroup(t *testing.T) {
111 h0 := NewBatchHandler(BatchOptions{

Callers

nothing calls this directly

Calls 2

SetLevelMethod · 0.95
NewBatchHandlerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…