想要的打印效果 **<10:39:29 LEWebViewController.swift:72>-:deinit**
/** 代替Swift的 print打印 */
func LE_NSLog(message: AnyObject, file: String = #file, function: String = #function, lineNum: Int = #line) {
#if LE_DEBUG
let interval = NSTimeZone.systemTimeZone().secondsFromGMTForDate(NSDate())
let date = NSDate().dateByAddingTimeInterval(Double(interval))
let dateStr = String(date)
let subStr = (dateStr as NSString).substringWithRange(NSMakeRange(11, 8))
print("<\(subStr) \((file as NSString).pathComponents.last!):\(lineNum)>-:\(message)")
#endif
}
Paste_Image.png
参考文章:
http://www.jianshu.com/p/69cfa999b4a3
网友评论