标签:last http orm form ast 使用 控制台 ima code
Swift 自定义打印方法
#代码如下
// MARK:- 自定义打印方法 func MLLog<T>(_ message : T, file : String = #file, funcName : String = #function, lineNum : Int = #line) { #if DEBUG // 创建一个日期格式器 let dformatter = DateFormatter() // 为日期格式器设置格式字符串 dformatter.dateFormat = "yyyy-MM-dd HH:mm:ss" // 使用日期格式器格式化当前日期、时间 let datestr = dformatter.string(from: Date()) let fileName = (file as NSString).lastPathComponent print("[\(datestr)] - [\(fileName)] [第\(lineNum)行] \(message)") #endif }
控制台输出
标签:last http orm form ast 使用 控制台 ima code
原文地址:http://www.cnblogs.com/Milo-CTO/p/7484781.html