-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
mock.go
47 lines (37 loc) · 962 Bytes
/
mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package logutils
import (
"github.com/stretchr/testify/mock"
)
type MockLog struct {
mock.Mock
}
func NewMockLog() *MockLog {
return &MockLog{}
}
func (m *MockLog) Fatalf(format string, args ...interface{}) {
mArgs := []interface{}{format}
m.Called(append(mArgs, args...)...)
}
func (m *MockLog) Panicf(format string, args ...interface{}) {
mArgs := []interface{}{format}
m.Called(append(mArgs, args...)...)
}
func (m *MockLog) Errorf(format string, args ...interface{}) {
mArgs := []interface{}{format}
m.Called(append(mArgs, args...)...)
}
func (m *MockLog) Warnf(format string, args ...interface{}) {
mArgs := []interface{}{format}
m.Called(append(mArgs, args...)...)
}
func (m *MockLog) Infof(format string, args ...interface{}) {
mArgs := []interface{}{format}
m.Called(append(mArgs, args...)...)
}
func (m *MockLog) Child(name string) Log {
m.Called(name)
return m
}
func (m *MockLog) SetLevel(level LogLevel) {
m.Called(level)
}