func DCLog<T>(message: T,fileName: String = #file,methodName: String = #function,lineNumber: Int = #line) { #if DEBUG //这里请资参考 如何http://my.oschina.net/zhaodacai/blog/683457 // print("\((fileName as NSString).pathComponents.last!).\(methodName)[\(lineNumber)]:\(message)") print("\(methodName)[\(lineNumber)]:\(message)") #endif }原文链接:https://www.f2er.com/swift/323666.html