logline

package
v1.18.0-rc.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCaptureAll

func WithCaptureAll() func(*options)

WithCaptureAll enables continuous log capture mode, where all logs are captured to the buffer even without specific expected lines configured. This is useful for tests that need to dynamically check log contents using Contains() or Reset().

func WithStderrLineContains

func WithStderrLineContains(lines ...string) func(*options)

func WithStdoutLineContains

func WithStdoutLineContains(lines ...string) func(*options)

Types

type LogLine

type LogLine struct {
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, fopts ...Option) *LogLine

func (*LogLine) Cleanup

func (l *LogLine) Cleanup(t *testing.T)

func (*LogLine) Contains added in v1.17.7

func (l *LogLine) Contains(substr string) bool

Contains checks if the captured log output contains the given substring. This is useful for dynamic log checking during tests.

func (*LogLine) EventuallyContains

func (l *LogLine) EventuallyContains(t assert.TestingT, substr string, timeout time.Duration, tick time.Duration) bool

EventuallyContains waits for the captured log output to contain the given substring within the specified timeout.

func (*LogLine) EventuallyFoundAll

func (l *LogLine) EventuallyFoundAll(t *testing.T)

func (*LogLine) EventuallyFoundNone added in v1.16.1

func (l *LogLine) EventuallyFoundNone(t *testing.T)

func (*LogLine) FoundAll

func (l *LogLine) FoundAll() bool

func (*LogLine) FoundNone added in v1.16.1

func (l *LogLine) FoundNone() bool

func (*LogLine) Reset

func (l *LogLine) Reset()

Reset clears the captured log buffer. This is useful when testing configuration reloads where you want to verify new log output after a reload without interference from previous log entries.

func (*LogLine) Run

func (l *LogLine) Run(t *testing.T, ctx context.Context)

func (*LogLine) Stderr

func (l *LogLine) Stderr() io.WriteCloser

func (*LogLine) Stdout

func (l *LogLine) Stdout() io.WriteCloser

func (*LogLine) StdoutBuffer added in v1.16.4

func (l *LogLine) StdoutBuffer() []byte

type Option

type Option func(*options)

Option is a function that configures the process.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL