diff --git a/Umpah-iOS/Umpah-iOS/Global/Utils/Logger.swift b/Umpah-iOS/Umpah-iOS/Global/Utils/Logger.swift new file mode 100644 index 0000000..341774e --- /dev/null +++ b/Umpah-iOS/Umpah-iOS/Global/Utils/Logger.swift @@ -0,0 +1,20 @@ +// +// Logger.swift +// Umpah-iOS +// +// Created by 장혜령 on 2022/02/18. +// + +import Foundation + +class Logger { + static func debugDescription(_ object: T?, filename: String = #file, line: Int = #line, funcName: String = #function) { + #if DEBUG + if let obj = object { + print("\(Date()) \(filename.components(separatedBy: "/").last ?? "")(\(line)) : \(funcName) : \(obj)") + } else { + print("\(Date()) \(filename.components(separatedBy: "/").last ?? "")(\(line)) : \(funcName) : nil") + } + #endif + } +}