forked from Zero-zhou/iOS-Extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDEBUGLog.swift
42 lines (30 loc) · 1.15 KB
/
DEBUGLog.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// DEBUGLog.swift
//
// Created by Augus on 2/21/16.
// Copyright © 2016 iAugus. All rights reserved.
//
import Foundation
#if DEBUG
// func DEBUGLog(_ message: String?, filename: NSString = #file, function: String = #function, line: Int = #line) {
// NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message)")
// }
func DEBUGLog(_ message: Any?, filename: NSString = #file, function: String = #function, line: Int = #line) {
NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message)")
}
func DEBUGPrint(_ any: Any?) {
print(any ?? "nil")
}
func DEBUGPrint(_ any: Any?, prefix: String = "", suffix: String = "") {
print(prefix + "\(any)" + suffix)
}
#else
// func DEBUGLog(_ message: String?, filename: String = #file, function: String = #function, line: Int = #line) {
// }
func DEBUGLog(_ message: Any?, filename: NSString = #file, function: String = #function, line: Int = #line) {
}
func DEBUGPrint(_ any: Any?) {
}
func DEBUGPrint(_ any: Any?, prefix: String = "", suffix: String = "") {
}
#endif