MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / enabled

Method enabled

base/log_keys.go:138–151  ·  view source on GitHub ↗

enabled returns true if the given logKey is enabled in keyMask, with an optional wildcard check.

(logKey LogKey, checkWildcards bool)

Source from the content-addressed store, hash-verified

136
137// enabled returns true if the given logKey is enabled in keyMask, with an optional wildcard check.
138func (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
154func (logKeyMask LogKeyMask) String() string {

Callers 3

EnabledMethod · 0.95
EnabledLogKeysMethod · 0.95

Calls 1

KeyMaskValueMethod · 0.80

Tested by

no test coverage detected