testutils

package
v0.0.0-...-6cc63a5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemorySink

type MemorySink struct {
	*bytes.Buffer
}

MemorySink implements zap.Sink by writing all messages to a buffer.

func NewLoggerWithMemorySink

func NewLoggerWithMemorySink() (log.Logger, *MemorySink, error)

NewLoggerWithMemorySink creates a new logger with a memory sink, to which all output is redirected. Calling sink.String() / sink.Bytes() ... will give access to its contents.

func (*MemorySink) Close

func (s *MemorySink) Close() error

Close is a nop method to satisfy the zap.Sink interface

func (*MemorySink) Sync

func (s *MemorySink) Sync() error

Sync is a nop method to satisfy the zap.Sink interface

Jump to

Keyboard shortcuts

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