在做项目的过程中自定义了print打印,跟原生效果一样。支持多参数的打印。
代码如下:
func PLog(_items:Any...,separator:String=" ",file:String=#file,function:String=#function,line:Int=#line){
#if DEBUG
let file = (file as NSString).lastPathComponent.split(separator: ".").first!;
print("打印--> \(file) \(function) [Line: \(line)]: 🏇🏇🏇🏇🏇👉👉👉 \(items)",separator);
#endif
}