AllEntries returns all entries that were logged.
()
| 72 | |
| 73 | // AllEntries returns all entries that were logged. |
| 74 | func (t *Hook) AllEntries() []*logrus.Entry { |
| 75 | t.mu.RLock() |
| 76 | defer t.mu.RUnlock() |
| 77 | // Make a copy so the returned value won't race with future log requests |
| 78 | entries := make([]*logrus.Entry, len(t.Entries)) |
| 79 | for i := 0; i < len(t.Entries); i++ { |
| 80 | // Make a copy, for safety |
| 81 | entries[i] = &t.Entries[i] |
| 82 | } |
| 83 | return entries |
| 84 | } |
| 85 | |
| 86 | // Reset removes all Entries from this test hook. |
| 87 | func (t *Hook) Reset() { |
no outgoing calls