logger

package
v0.0.0-...-44a5619 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Set = wire.NewSet(
	New,
)

Set provides an implementation and interface for Logger.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	AddFlags(f *pflag.FlagSet)
	Printf(format string, args ...interface{})
	V(level int) Verbose
	IsEnabled(level int) bool
}

func New

func New() Interface

New returns a Logger with the standard log.Logger and klog.

type Logger

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

Logger provides logging facility using log.Logger and klog.

func (*Logger) AddFlags

func (*Logger) AddFlags(f *pflag.FlagSet)

AddFlags adds the flags such as -v.

func (*Logger) IsEnabled

func (*Logger) IsEnabled(level int) bool

IsEnabled returns true if the level is enabled.

func (*Logger) V

func (*Logger) V(level int) Verbose

V returns a logger enabled only if the level is enabled.

type MockInterface

type MockInterface struct {
	mock.Mock
}

MockInterface is an autogenerated mock type for the Interface type

func NewMockInterface

func NewMockInterface(t mockConstructorTestingTNewMockInterface) *MockInterface

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

func (*MockInterface) AddFlags

func (_m *MockInterface) AddFlags(f *pflag.FlagSet)

AddFlags provides a mock function with given fields: f

func (*MockInterface) EXPECT

func (_m *MockInterface) EXPECT() *MockInterface_Expecter

func (*MockInterface) IsEnabled

func (_m *MockInterface) IsEnabled(level int) bool

IsEnabled provides a mock function with given fields: level

func (*MockInterface) Printf

func (_m *MockInterface) Printf(format string, args ...interface{})

Printf provides a mock function with given fields: format, args

func (*MockInterface) V

func (_m *MockInterface) V(level int) Verbose

V provides a mock function with given fields: level

type MockInterface_AddFlags_Call

type MockInterface_AddFlags_Call struct {
	*mock.Call
}

MockInterface_AddFlags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFlags'

func (*MockInterface_AddFlags_Call) Return

func (*MockInterface_AddFlags_Call) Run

type MockInterface_Expecter

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

func (*MockInterface_Expecter) AddFlags

func (_e *MockInterface_Expecter) AddFlags(f interface{}) *MockInterface_AddFlags_Call

AddFlags is a helper method to define mock.On call

  • f *pflag.FlagSet

func (*MockInterface_Expecter) IsEnabled

func (_e *MockInterface_Expecter) IsEnabled(level interface{}) *MockInterface_IsEnabled_Call

IsEnabled is a helper method to define mock.On call

  • level int

func (*MockInterface_Expecter) Printf

func (_e *MockInterface_Expecter) Printf(format interface{}, args ...interface{}) *MockInterface_Printf_Call

Printf is a helper method to define mock.On call

  • format string
  • args ...interface{}

func (*MockInterface_Expecter) V

func (_e *MockInterface_Expecter) V(level interface{}) *MockInterface_V_Call

V is a helper method to define mock.On call

  • level int

type MockInterface_IsEnabled_Call

type MockInterface_IsEnabled_Call struct {
	*mock.Call
}

MockInterface_IsEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsEnabled'

func (*MockInterface_IsEnabled_Call) Return

func (*MockInterface_IsEnabled_Call) Run

type MockInterface_Printf_Call

type MockInterface_Printf_Call struct {
	*mock.Call
}

MockInterface_Printf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Printf'

func (*MockInterface_Printf_Call) Return

func (*MockInterface_Printf_Call) Run

func (_c *MockInterface_Printf_Call) Run(run func(format string, args ...interface{})) *MockInterface_Printf_Call

type MockInterface_V_Call

type MockInterface_V_Call struct {
	*mock.Call
}

MockInterface_V_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'V'

func (*MockInterface_V_Call) Return

func (*MockInterface_V_Call) Run

func (_c *MockInterface_V_Call) Run(run func(level int)) *MockInterface_V_Call

type MockVerbose

type MockVerbose struct {
	mock.Mock
}

MockVerbose is an autogenerated mock type for the Verbose type

func NewMockVerbose

func NewMockVerbose(t mockConstructorTestingTNewMockVerbose) *MockVerbose

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

func (*MockVerbose) EXPECT

func (_m *MockVerbose) EXPECT() *MockVerbose_Expecter

func (*MockVerbose) Infof

func (_m *MockVerbose) Infof(format string, args ...interface{})

Infof provides a mock function with given fields: format, args

type MockVerbose_Expecter

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

func (*MockVerbose_Expecter) Infof

func (_e *MockVerbose_Expecter) Infof(format interface{}, args ...interface{}) *MockVerbose_Infof_Call

Infof is a helper method to define mock.On call

  • format string
  • args ...interface{}

type MockVerbose_Infof_Call

type MockVerbose_Infof_Call struct {
	*mock.Call
}

MockVerbose_Infof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Infof'

func (*MockVerbose_Infof_Call) Return

func (*MockVerbose_Infof_Call) Run

func (_c *MockVerbose_Infof_Call) Run(run func(format string, args ...interface{})) *MockVerbose_Infof_Call

type Verbose

type Verbose interface {
	Infof(format string, args ...interface{})
}

Jump to

Keyboard shortcuts

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