Skip to content
Snippets Groups Projects
Select Git revision
  • b32eed3962e8f82dacc387a9b8efae461eb8177b
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

SetLogLevel.swift

Blame
  • SetLogLevel.swift 574 B
    import Bindings
    import XCTestDynamicOverlay
    
    public struct SetLogLevel {
      public var run: (LogLevel) throws -> Bool
    
      public func callAsFunction(_ logLevel: LogLevel) throws -> Bool {
        try run(logLevel)
      }
    }
    
    extension SetLogLevel {
      public static let live = SetLogLevel { logLevel in
        var error: NSError?
        let result = BindingsLogLevel(logLevel.rawValue, &error)
        if let error = error {
          throw error
        }
        return result
      }
    }
    
    extension SetLogLevel {
      public static let unimplemented = SetLogLevel(
        run: XCTUnimplemented("\(Self.self)")
      )
    }