Created
July 13, 2020 14:47
-
-
Save imnaveensharma/c050208cf9928fcec4e7d58bfa1d5987 to your computer and use it in GitHub Desktop.
Constant file with custom methods to print logs with extra informations for development/debug phase only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if DEBUG | |
| func dLog(message: String, filename: String = #file, function: String = #function, line: Int = #line) { | |
| print("[\((filename as NSString).lastPathComponent):\(line)] \(function) - \(String(describing: message))") | |
| } | |
| func classStart(filename: String = #file, function: String = #function, line: Int = #line) { | |
| print("ClassStart", "[\((filename as NSString).lastPathComponent):\(line)] \(function)") | |
| } | |
| func classEnd(filename: String = #file, function: String = #function, line: Int = #line) { | |
| print("ClassEnd", "[\((filename as NSString).lastPathComponent):\(line)] \(function)") | |
| } | |
| func classReleased(filename: String = #file, function: String = #function, line: Int = #line) { | |
| print("ClassReleased", "[\((filename as NSString).lastPathComponent):\(line)] \(function)") | |
| } | |
| func fLog(filename: String = #file, function: String = #function, line: Int = #line) { | |
| print("FlowAction", "[\((filename as NSString).lastPathComponent):\(line)] \(function)") | |
| } | |
| #else | |
| func dLog(message: String, filename: String = #file, function: String = #function, line: Int = #line) { | |
| } | |
| func classStart(filename: String = #file, function: String = #function, line: Int = #line) { | |
| } | |
| func classEnd(filename: String = #file, function: String = #function, line: Int = #line) { | |
| } | |
| func classReleased(filename: String = #file, function: String = #function, line: Int = #line) { | |
| } | |
| func fLog(filename: String = #file, function: String = #function, line: Int = #line) { | |
| } | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment