struct Log {
static func debug<T>(_ message: T, file: String = #file, function: String = #function, line: Int = #line) {
#if DEBUG
//获取文件名
let fileName = (file as NSString).lastPathComponent
//打印日志内容
print("Debug: \(fileName):\(line) \(function) | \(message)")
#endif
}
}
网友评论