All returns a copy of all the observed logs.
()
| 49 | |
| 50 | // All returns a copy of all the observed logs. |
| 51 | func (o *ObservedLogs) All() []LoggedEntry { |
| 52 | o.mu.RLock() |
| 53 | ret := make([]LoggedEntry, len(o.logs)) |
| 54 | copy(ret, o.logs) |
| 55 | o.mu.RUnlock() |
| 56 | return ret |
| 57 | } |
| 58 | |
| 59 | // TakeAll returns a copy of all the observed logs, and truncates the observed |
| 60 | // slice. |
no outgoing calls