struct _logLevel: OptionSet {

        let rawValue: Int

        static let critical    = _logLevel(rawValue: 1 << 0)

        static let major  = _logLevel(rawValue: 1 << 1)

        static let minor   = _logLevel(rawValue: 1 << 2)

        static let just   = _logLevel(rawValue: 1 << 3)

        static let graph = _logLevel(rawValue: 1 << 4)

        static let current = _logLevel(rawValue: 1 << 5)

        static let fixing = _logLevel(rawValue: 1 << 6)

        static let motion = _logLevel(rawValue: 1 << 7)

        static let network = _logLevel(rawValue: 1 << 8)

        static let network2 = _logLevel(rawValue: 1 << 9)

        static let none = _logLevel(rawValue: 1 << 10)

        static let layer = _logLevel(rawValue: 1 << 11)

        static let json = _logLevel(rawValue: 1 << 12)

        static let share = _logLevel(rawValue: 1 << 13)

        static let guideline = _logLevel(rawValue: 1 << 14)

        static let calendar = _logLevel(rawValue: 1 << 15)

        static let refresh = _logLevel(rawValue: 1 << 16)

        static let location = _logLevel(rawValue: 1 << 17)

        static let all: _logLevel = [.critical, .major, .minor, .just, .graph, .current, .location, .fixing, .motion, .network, .network2, .layer, .json, .share, .guideline, .calendar, .refresh]

    }

 

class GS {

    

    static let s = GS()

    

    var totalScore : Int? = 0

    

    var logLevel: _logLevel = .current

 

 

if GS.s.logLevel == .motion { debugPrint("didSwipe Down") }

 

if GS.s.logLevel == .fixing {

 

 

if(!GS.s.logLevel.contains(.none)) {

 

 

나름 나의 고급 기술인데 오픈한다.

 

로그 레벨을 나눈 것과 아닌 프로젝트의 차이는 트러블슈팅에서 천지차이.

 

 

 

+ Recent posts