디버깅할 때만 print하는 편한 녀석
func logput(_ items: Any...,
            file: String = #file,
            line: Int = #line,
            function: String = #function) {
    #if DEBUG
    let fileName = URL(fileURLWithPath: file).lastPathComponent
    var array: [Any] = ["💫Log: \(fileName)", "Line:\(line)", function]
    array.append(contentsOf: items)
    Swift.print(array)
    #endif
}
logput("hello", "world", 3.14)
출력 예["💫Log: AppDelegate.swift", "Line:42", "applicationDidFinishLaunching(_:)", "hello", "world", 3.14]
                Reference
이 문제에 관하여(디버깅할 때만 print하는 편한 녀석), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/kyome/articles/4c1ee00c139da3텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)