自定义log

一、自定义log,代码放入AppDelegate中

1
2
3
4
5
func LXLog<T>(message: T,fileName:String = #file, methodName:String = #function, lineNumber:Int = #line){
#if DEBUG
print("((fileName as NSString).pathComponents.last!).(methodName)[(lineNumber)]:(message)")
#endif
}

二、Xcode8.0去除控制台多余打印信息

选择Product->Scheme->Edit Scheme->Run->Environment Variables 下添加 键:0S_ACTIVITY_MODE,值:disable