美文网首页
Swift-DEBUG模式下打印设置

Swift-DEBUG模式下打印设置

作者: 小猪蛋蛋 | 来源:发表于2021-01-28 18:09 被阅读0次

    Xcode配置

    image.png

    打印代码

    //Debug模式下打印
    func PrintLog<T>(message: T, fileName: String = #file, funcName: String = #function, lineNum : Int = #line) {
        #if DEBUG
             // 1.对文件进行处理
            let file = (fileName as NSString).lastPathComponent
            // 2.打印内容
            print("[\(file)]]-->[\(funcName)]-->第\(lineNum)行\("\n")打印信息:\(message)")
        #endif
    }
    

    相关文章

      网友评论

          本文标题:Swift-DEBUG模式下打印设置

          本文链接:https://www.haomeiwen.com/subject/eajxtltx.html