Swift debug打印

    /// 调试方法打印输出
    func debugPrint(_ message: T, filePath: String = #file, function:String = #function, rowCount: Int = #line) {
        #if DEBUG
        let fileName = (filePath as NSString).lastPathComponent.replacingOccurrences(of: ".swift", with: "")
        print(fileName + "/ " + "\(rowCount)" + "/ " + "\(function)" + " ->: \(message)")
        #endif
    }

你可能感兴趣的:(iOS)