| 164 | } |
| 165 | |
| 166 | func (t *testLogSpy) Logf(format string, args ...interface{}) { |
| 167 | // Log messages are in the format, |
| 168 | // |
| 169 | // 2017-10-27T13:03:01.000-0700 DEBUG your message here {data here} |
| 170 | // |
| 171 | // We strip the first part of these messages because we can't really test |
| 172 | // for the timestamp from these tests. |
| 173 | m := fmt.Sprintf(format, args...) |
| 174 | m = m[strings.IndexByte(m, '\t')+1:] |
| 175 | t.Messages = append(t.Messages, m) |
| 176 | t.TB.Log(m) |
| 177 | } |
| 178 | |
| 179 | func (t *testLogSpy) AssertMessages(msgs ...string) { |
| 180 | assert.Equal(t.TB, msgs, t.Messages, "logged messages did not match") |