Set changes the value of a field (either standard or custom) to a new value.
(f FieldIndex, data []byte)
| 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) { |
| 95 | if l.wmask[f] != 0 { |
| 96 | l.wdata[l.wmask[f]] = data |
| 97 | return |
| 98 | } |
| 99 | l.wcnt++ |
| 100 | if l.wcnt == 0 { |
| 101 | panic("too many fields changed") |
| 102 | } |
| 103 | l.wmask[f] = l.wcnt |
| 104 | l.wdata[l.wcnt] = data |
| 105 | } |
| 106 | |
| 107 | var errLogLineTooManyFields = errors.New("LogLine has too many fields") |
| 108 |
no outgoing calls