enabled returns true if the given logKey is enabled in keyMask, with an optional wildcard check.
(logKey LogKey, checkWildcards bool)
| 136 | |
| 137 | // enabled returns true if the given logKey is enabled in keyMask, with an optional wildcard check. |
| 138 | func (keyMask *LogKeyMask) enabled(logKey LogKey, checkWildcards bool) bool { |
| 139 | if keyMask == nil { |
| 140 | return false |
| 141 | } |
| 142 | |
| 143 | flag := atomic.LoadUint64((*uint64)(keyMask)) |
| 144 | |
| 145 | // If KeyAll is set, return true for everything. |
| 146 | if checkWildcards && flag&KeyAll.KeyMaskValue() != 0 { |
| 147 | return true |
| 148 | } |
| 149 | |
| 150 | return flag&logKey.KeyMaskValue() != 0 |
| 151 | } |
| 152 | |
| 153 | // String returns the string representation of one or more log keys in a LogKeyMask |
| 154 | func (logKeyMask LogKeyMask) String() string { |
no test coverage detected