自定义打印
一般我们需要在Appdelegate中定义全局函数
func XLog<T>(_ message:T,file:String=#file,funcName:String=#function,lineNum:Int=#line){
#if DEBUG
let fileName = (file as NSString).lastPathComponent
print("\(fileName) \(funcName) line:\(lineNum) \n\(message)")
#endif
}
网友评论