目前SFJLog
方法APPDelegate
里面,后期看情况而定。
func SFJLog<T>(message: T, file: String = #file, funcName: String = #function, lineNumber: Int = #line) {
#if DEBUG
let fileName = (file as NSString).lastPathComponent
print("\(fileName): \(funcName) \(lineNumber): \(message)")
#endif
}
需要进行一系列的配置Build Setting
->Swift Flags
-> Debug
中添加-D DEBUG

注意这里的DEBUG与方法里面的DEBUG名字要保持一致。
网友评论