KeyMaskValue converts a log key index to the bitfield position. e.g. 0->0, 1->1, 2->2, 3->4, 4->8, 5->16...
()
| 100 | // KeyMaskValue converts a log key index to the bitfield position. |
| 101 | // e.g. 0->0, 1->1, 2->2, 3->4, 4->8, 5->16... |
| 102 | func (i LogKey) KeyMaskValue() uint64 { |
| 103 | if i == 0 { |
| 104 | return 0 |
| 105 | } |
| 106 | return 1 << (i - 1) |
| 107 | } |
| 108 | |
| 109 | // Enable will enable the given logKey in keyMask. |
| 110 | func (keyMask *LogKeyMask) Enable(logKey LogKey) { |