-
Notifications
You must be signed in to change notification settings - Fork 58
/
ilogger.go
166 lines (150 loc) · 4.55 KB
/
ilogger.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Code generated by counterfeiter. DO NOT EDIT.
// (with minor, manual edits)
package fakes
import (
"sync"
)
type FakeILogger struct {
DebugStub func(msg string, args map[string]interface{})
debugMutex sync.RWMutex
debugArgsForCall []struct {
msg string
args map[string]interface{}
}
InfoStub func(msg string, args map[string]interface{})
infoMutex sync.RWMutex
infoArgsForCall []struct {
msg string
args map[string]interface{}
}
WarnStub func(msg string, args map[string]interface{})
warnMutex sync.RWMutex
warnArgsForCall []struct {
msg string
args map[string]interface{}
}
ErrorStub func(msg string, args map[string]interface{})
errorMutex sync.RWMutex
errorArgsForCall []struct {
msg string
args map[string]interface{}
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeILogger) Debug(msg string, args map[string]interface{}) {
fake.debugMutex.Lock()
fake.debugArgsForCall = append(fake.debugArgsForCall, struct {
msg string
args map[string]interface{}
}{msg, args})
fake.recordInvocation("Debug", []interface{}{msg, args})
fake.debugMutex.Unlock()
if fake.DebugStub != nil {
fake.DebugStub(msg, args)
}
}
func (fake *FakeILogger) DebugCallCount() int {
fake.debugMutex.RLock()
defer fake.debugMutex.RUnlock()
return len(fake.debugArgsForCall)
}
func (fake *FakeILogger) DebugArgsForCall(i int) (string, map[string]interface{}) {
fake.debugMutex.RLock()
defer fake.debugMutex.RUnlock()
return fake.debugArgsForCall[i].msg, fake.debugArgsForCall[i].args
}
func (fake *FakeILogger) Info(msg string, args map[string]interface{}) {
fake.infoMutex.Lock()
fake.infoArgsForCall = append(fake.infoArgsForCall, struct {
msg string
args map[string]interface{}
}{msg, args})
fake.recordInvocation("Info", []interface{}{msg, args})
fake.infoMutex.Unlock()
if fake.InfoStub != nil {
fake.InfoStub(msg, args)
}
}
func (fake *FakeILogger) InfoCallCount() int {
fake.infoMutex.RLock()
defer fake.infoMutex.RUnlock()
return len(fake.infoArgsForCall)
}
func (fake *FakeILogger) InfoArgsForCall(i int) (string, map[string]interface{}) {
fake.infoMutex.RLock()
defer fake.infoMutex.RUnlock()
return fake.infoArgsForCall[i].msg, fake.infoArgsForCall[i].args
}
func (fake *FakeILogger) Warn(msg string, args map[string]interface{}) {
fake.warnMutex.Lock()
fake.warnArgsForCall = append(fake.warnArgsForCall, struct {
msg string
args map[string]interface{}
}{msg, args})
fake.recordInvocation("Warn", []interface{}{msg, args})
fake.warnMutex.Unlock()
if fake.WarnStub != nil {
fake.WarnStub(msg, args)
}
}
func (fake *FakeILogger) WarnCallCount() int {
fake.warnMutex.RLock()
defer fake.warnMutex.RUnlock()
return len(fake.warnArgsForCall)
}
func (fake *FakeILogger) WarnArgsForCall(i int) (string, map[string]interface{}) {
fake.warnMutex.RLock()
defer fake.warnMutex.RUnlock()
return fake.warnArgsForCall[i].msg, fake.warnArgsForCall[i].args
}
func (fake *FakeILogger) Error(msg string, args map[string]interface{}) {
fake.errorMutex.Lock()
fake.errorArgsForCall = append(fake.errorArgsForCall, struct {
msg string
args map[string]interface{}
}{msg, args})
fake.recordInvocation("Error", []interface{}{msg, args})
fake.errorMutex.Unlock()
if fake.ErrorStub != nil {
fake.ErrorStub(msg, args)
}
}
func (fake *FakeILogger) ErrorCallCount() int {
fake.errorMutex.RLock()
defer fake.errorMutex.RUnlock()
return len(fake.errorArgsForCall)
}
func (fake *FakeILogger) ErrorArgsForCall(i int) (string, map[string]interface{}) {
fake.errorMutex.RLock()
defer fake.errorMutex.RUnlock()
return fake.errorArgsForCall[i].msg, fake.errorArgsForCall[i].args
}
func (fake *FakeILogger) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.debugMutex.RLock()
defer fake.debugMutex.RUnlock()
fake.infoMutex.RLock()
defer fake.infoMutex.RUnlock()
fake.warnMutex.RLock()
defer fake.warnMutex.RUnlock()
fake.errorMutex.RLock()
defer fake.errorMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeILogger) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}