forked from gnachman/iTerm2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugLogging.h
More file actions
31 lines (25 loc) · 784 Bytes
/
DebugLogging.h
File metadata and controls
31 lines (25 loc) · 784 Bytes
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
//
// DebugLogging.h
// iTerm
//
// Created by George Nachman on 10/13/13.
//
//
#import <Foundation/Foundation.h>
extern BOOL gDebugLogging;
// I use a variadic macro here because of an apparent compiler bug in XCode 4.2 that thinks a
// variadaic objc call as an argument is not a single value.
#define DebugLog(args...) DebugLogImpl(__FILE__, __LINE__, __FUNCTION__, args)
//#define GENERAL_VERBOSE_LOGGING
#ifdef GENERAL_VERBOSE_LOGGING
#define DLog NSLog
#else
#define DLog(args...) \
do { \
if (gDebugLogging) { \
DebugLogImpl(__FILE__, __LINE__, __FUNCTION__, [NSString stringWithFormat:args]); \
} \
} while (0)
#endif
void ToggleDebugLogging();
int DebugLogImpl(const char *file, int line, const char *function, NSString* value);