logdrop

package
v1.16.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MPL-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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