(session *session)
| 74 | } |
| 75 | |
| 76 | func (l *Logger) Remove(session *session) { |
| 77 | l.mu.Lock() |
| 78 | defer l.mu.Unlock() |
| 79 | index := -1 |
| 80 | for i, v := range l.sessions { |
| 81 | if v == session { |
| 82 | index = i |
| 83 | break |
| 84 | } |
| 85 | } |
| 86 | if index == -1 { |
| 87 | // Not found |
| 88 | return |
| 89 | } |
| 90 | copy(l.sessions[index:], l.sessions[index+1:]) |
| 91 | l.sessions = l.sessions[:len(l.sessions)-1] |
| 92 | } |
| 93 | |
| 94 | // Write will write the log event to all sessions that have available capacity. For those that are full, the message |
| 95 | // will be dropped. |
no outgoing calls