Documentation
¶
Overview ¶
Package logging provides repository-internal structured logging test helpers.
Index ¶
- type TestLogger
- func (tl *TestLogger) AssertContains(t testing.TB, substr string)
- func (tl *TestLogger) AssertCount(t testing.TB, expected int)
- func (tl *TestLogger) AssertNotContains(t testing.TB, substr string)
- func (tl *TestLogger) Clear()
- func (tl *TestLogger) Contains(substr string) bool
- func (tl *TestLogger) ContainsAll(substrs ...string) bool
- func (tl *TestLogger) ContainsAny(substrs ...string) bool
- func (tl *TestLogger) Count() int
- func (tl *TestLogger) Lines() []string
- func (tl *TestLogger) Output() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestLogger ¶
TestLogger creates a test logger that captures output.
func (*TestLogger) AssertContains ¶
func (tl *TestLogger) AssertContains(t testing.TB, substr string)
AssertContains asserts that the log contains the given string.
func (*TestLogger) AssertCount ¶
func (tl *TestLogger) AssertCount(t testing.TB, expected int)
AssertCount asserts that the log has the expected number of entries.
func (*TestLogger) AssertNotContains ¶
func (tl *TestLogger) AssertNotContains(t testing.TB, substr string)
AssertNotContains asserts that the log does not contain the given string.
func (*TestLogger) Contains ¶
func (tl *TestLogger) Contains(substr string) bool
Contains checks if the log output contains the given string.
func (*TestLogger) ContainsAll ¶
func (tl *TestLogger) ContainsAll(substrs ...string) bool
ContainsAll checks if the log output contains all given strings.
func (*TestLogger) ContainsAny ¶
func (tl *TestLogger) ContainsAny(substrs ...string) bool
ContainsAny checks if the log output contains any of the given strings.
func (*TestLogger) Count ¶
func (tl *TestLogger) Count() int
Count returns the number of log entries.
func (*TestLogger) Lines ¶
func (tl *TestLogger) Lines() []string
Lines returns the captured log output as individual lines.
func (*TestLogger) Output ¶
func (tl *TestLogger) Output() string
Output returns the captured log output as a string.