(node string, source LogSource, content string)
| 65 | } |
| 66 | |
| 67 | func (m *LogManager) Accept(node string, source LogSource, content string) { |
| 68 | m.mu.Lock() |
| 69 | defer m.mu.Unlock() |
| 70 | |
| 71 | event := LogEvent{ |
| 72 | At: time.Since(m.start), |
| 73 | Node: node, |
| 74 | Source: source, |
| 75 | Content: content, |
| 76 | } |
| 77 | key := sourceKey{node, source} |
| 78 | m.histories[key] = append(m.histories[key], event) |
| 79 | for _, observer := range m.observers { |
| 80 | observer(event) |
| 81 | } |
| 82 | m.checkMatchLocked(key) |
| 83 | } |
| 84 | |
| 85 | func (m *LogManager) checkMatchLocked(key sourceKey) { |
| 86 | sub, ok := m.subscribers[key] |
no test coverage detected