logdrop

package
v1.16.102 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogDropSink

func NewLogDropSink(ctx context.Context, depth int, logger Logger, dropFn func(l Log)) hclog.SinkAdapter

NewLogDropSink create a log Logger that wrap another Logger It also create a go routine for consuming logs, the given context need to be canceled to properly deallocate the Logger.

Types

type Log

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

type Logger

type Logger interface {
	Log(level hclog.Level, msg string, args ...interface{})
}

Logger mimic the interface from hclog.Logger

type MockLogger

type MockLogger struct {
	mock.Mock
}

MockLogger is an autogenerated mock type for the Logger type

func NewMockLogger

func NewMockLogger(t testing.TB) *MockLogger

NewMockLogger creates a new instance of MockLogger. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockLogger) Log

func (_m *MockLogger) Log(level hclog.Level, msg string, args ...interface{})

Log provides a mock function with given fields: level, msg, args

Jump to

Keyboard shortcuts

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