本文共 397 字,大约阅读时间需要 1 分钟。
1.在AppDelegate.swift中自定义方法
func NJLog(message: T, fileName: String = #file, methodName: String = #function, lineNumber: Int = #line){ #if DEBUG // 要把路径最后的字符串截取出来 let fName = ((fileName as NSString).pathComponents.last!) print("\(fName).\(methodName)[\(lineNumber)]: \(message)") #endif}
转载地址:http://rntmb.baihongyu.com/