How to print out the method name and line number in swift

后端 未结 4 1351
礼貌的吻别
礼貌的吻别 2020-12-12 18:26

Here is an example of what I want to do:

func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError)
{
            


        
4条回答
  •  执笔经年
    2020-12-12 18:38

    static func DLog(message: String, file: String = #file, function: String = #function, line: Int = #line, column: Int = #column) {
        print("\(file) : \(function) : \(line) : \(column) - \(message)")
    }
    

提交回复
热议问题