logger

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogCapture

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

LogCapture allows testing code to query log output.

func NewLogCapture

func NewLogCapture() *LogCapture

NewLogCapture captures logs for querying. Logs are created in JSON format and without timestamps.

func (*LogCapture) AssertHasEntry

func (c *LogCapture) AssertHasEntry(t *testing.T, msg string)

AssertHasEntry checks if there is a log entry with the given string.

func (*LogCapture) Entries

func (c *LogCapture) Entries() []map[string]interface{}

Entries returns all captures log entries.

func (*LogCapture) HasLog added in v1.6.0

func (c *LogCapture) HasLog(fields map[string]interface{}) bool

HasLog returns true if there is a log entry with the matching fields.

func (*LogCapture) Write added in v1.6.0

func (c *LogCapture) Write(p []byte) (int, error)

Write captures an individual log message.

Jump to

Keyboard shortcuts

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