swift 自定义打印方法
2021-02-20 本文已影响0人
阳光天天耀
func WPrint(_msg:T,file:String = #file, lineNum:Int = #line) {
#if DEBUG
let fileArr = file.components(separatedBy: ["/","."])
let filename = fileArr[fileArr.endIndex-2];
print("\(filename)(\(lineNum)): \(msg)");
#endif
}