Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 28, 2024
1 parent 1b13606 commit 44e0029
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions pkg/logutils/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,23 @@ func NewMockLog() *MockLog {
}

func (m *MockLog) Fatalf(format string, args ...any) {
mArgs := []any{format}
m.Called(append(mArgs, args...)...)
m.Called(append([]any{format}, args...)...)
}

func (m *MockLog) Panicf(format string, args ...any) {
mArgs := []any{format}
m.Called(append(mArgs, args...)...)
m.Called(append([]any{format}, args...)...)
}

func (m *MockLog) Errorf(format string, args ...any) {
mArgs := []any{format}
m.Called(append(mArgs, args...)...)
m.Called(append([]any{format}, args...)...)
}

func (m *MockLog) Warnf(format string, args ...any) {
mArgs := []any{format}
m.Called(append(mArgs, args...)...)
m.Called(append([]any{format}, args...)...)
}

func (m *MockLog) Infof(format string, args ...any) {
mArgs := []any{format}
m.Called(append(mArgs, args...)...)
m.Called(append([]any{format}, args...)...)
}

func (m *MockLog) Child(name string) Log {
Expand All @@ -55,35 +50,31 @@ func (m *MockLog) OnFatalf(format string, args ...any) *MockLog {
}

func (m *MockLog) OnPanicf(format string, args ...any) *MockLog {
arguments := []any{format}
arguments = append(arguments, args...)
arguments := append([]any{format}, args...)

m.On("Panicf", arguments...)

return m
}

func (m *MockLog) OnErrorf(format string, args ...any) *MockLog {
arguments := []any{format}
arguments = append(arguments, args...)
arguments := append([]any{format}, args...)

m.On("Errorf", arguments...)

return m
}

func (m *MockLog) OnWarnf(format string, args ...any) *MockLog {
arguments := []any{format}
arguments = append(arguments, args...)
arguments := append([]any{format}, args...)

m.On("Warnf", arguments...)

return m
}

func (m *MockLog) OnInfof(format string, args ...any) *MockLog {
arguments := []any{format}
arguments = append(arguments, args...)
arguments := append([]any{format}, args...)

m.On("Infof", arguments...)

Expand Down

0 comments on commit 44e0029

Please sign in to comment.