Get the value of a field (either standard or custom).
(f FieldIndex)
| 75 | |
| 76 | // Get the value of a field (either standard or custom). |
| 77 | func (l *LogLine) Get(f FieldIndex) []byte { |
| 78 | if idx := l.wmask[f]; idx != 0 { |
| 79 | return l.wdata[idx] |
| 80 | } |
| 81 | if f >= LogLineNumFields { |
| 82 | return nil |
| 83 | } |
| 84 | |
| 85 | s := l.idx[f] + 1 |
| 86 | e := l.idx[f+1] |
| 87 | if e-s < 1 { |
| 88 | return nil |
| 89 | } |
| 90 | return l.data[s:e] |
| 91 | } |
| 92 | |
| 93 | // Set changes the value of a field (either standard or custom) to a new value. |
| 94 | func (l *LogLine) Set(f FieldIndex, data []byte) { |
no outgoing calls