(t *testing.T)
| 15 | } |
| 16 | |
| 17 | func TestLogBody(t *testing.T) { |
| 18 | inBatch := plog.NewLogs() |
| 19 | rl := inBatch.ResourceLogs().AppendEmpty() |
| 20 | ils := rl.ScopeLogs().AppendEmpty() |
| 21 | library := ils.Scope() |
| 22 | library.SetName("first-library") |
| 23 | |
| 24 | logEntry := ils.LogRecords().AppendEmpty() |
| 25 | |
| 26 | body := redact.Sprintf("hello %s", "world") |
| 27 | logEntry.Body().SetStr(string(body)) |
| 28 | |
| 29 | ctx := context.Background() |
| 30 | processor := newRedactProcessor(ctx, &Config{}) |
| 31 | outBatch, err := processor.processLogs(ctx, inBatch) |
| 32 | assert.NoError(t, err) |
| 33 | outLogBody := outBatch.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0).Body().Str() |
| 34 | |
| 35 | require.Equal(t, string(body.Redact()), outLogBody) |
| 36 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…