LastEntry returns the last entry that was logged or nil.
()
| 61 | |
| 62 | // LastEntry returns the last entry that was logged or nil. |
| 63 | func (t *Hook) LastEntry() *logrus.Entry { |
| 64 | t.mu.RLock() |
| 65 | defer t.mu.RUnlock() |
| 66 | i := len(t.Entries) - 1 |
| 67 | if i < 0 { |
| 68 | return nil |
| 69 | } |
| 70 | return &t.Entries[i] |
| 71 | } |
| 72 | |
| 73 | // AllEntries returns all entries that were logged. |
| 74 | func (t *Hook) AllEntries() []*logrus.Entry { |
no outgoing calls