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
}
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
}
本文标题:swift 自定义打印方法
本文链接:https://www.haomeiwen.com/subject/bvetfltx.html
网友评论