-
Notifications
You must be signed in to change notification settings - Fork 7
/
DebugLog.h
66 lines (54 loc) · 1.46 KB
/
DebugLog.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// DebugLog.h
// NSLog wrapper
//
// DebugLog(msg) print Class, Selector, msg
// DebugLog0 print Class, Selector
// DebugLogMore(msg) print Filename, Line, Signature, msg
// DebugLogC(msg) print msg
//
// -Sticktron 2017
//
//
#ifdef DEBUG
// Default Prefix
#ifndef DEBUG_PREFIX
#define DEBUG_PREFIX @"[DebugLog]"
#endif
// Print styles
#define DebugLog(s, ...) \
NSLog(@"%@ %@::%@ >> %@", DEBUG_PREFIX, \
NSStringFromClass([self class]), \
NSStringFromSelector(_cmd), \
[NSString stringWithFormat:(s), ##__VA_ARGS__] \
)
#define DebugLog0 \
NSLog(@"%@ %@::%@", DEBUG_PREFIX, \
NSStringFromClass([self class]), \
NSStringFromSelector(_cmd) \
)
#define DebugLogC(s, ...) \
NSLog(@"%@ >> %@", DEBUG_PREFIX, \
[NSString stringWithFormat:(s), ##__VA_ARGS__] \
)
/*
#define DebugLogMore(s, ...) \
NSLog(@"%@ %s:(%d) >> %s >> %@", \
DEBUG_PREFIX, \
[[NSString stringWithUTF8String:__FILE__] lastPathComponent], \
__LINE__, \
__PRETTY_FUNCTION__, \
[NSString stringWithFormat:(s), \
##__VA_ARGS__] \
)
*/
//#define UA_SHOW_VIEW_BORDERS YES
//#define UA_showDebugBorderForViewColor(view, color) if (UA_SHOW_VIEW_BORDERS) { view.layer.borderColor = color.CGColor; view.layer.borderWidth = 1.0; }
//#define UA_showDebugBorderForView(view) UA_showDebugBorderForViewColor(view, [UIColor colorWithWhite:0.0 alpha:0.25])
#else
// Ignore macros
#define DebugLog(s, ...)
#define DebugLog0
#define DebugLogC(s, ...)
//#define DebugLogMore(s, ...)
#endif