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 Logger ¶
type Logger interface {
Log(level hclog.Level, msg string, args ...interface{})
}
Logger mimic the interface from hclog.Logger
type MockLogger ¶
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.
Click to show internal directories.
Click to hide internal directories.