-
Notifications
You must be signed in to change notification settings - Fork 87
/
SocksProxy_Prefix.pch
74 lines (48 loc) · 2.35 KB
/
SocksProxy_Prefix.pch
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
67
68
69
70
71
72
/*
* SocksProxy_Prefix.pch
* SOCKS
*
* Created by C. Bess on 9/5/10.
* Copyright 2010 Christopher Bess. All rights reserved.
*
*/
#ifdef __OBJC__
#import "UIDevice_Extended.h"
#endif
#include "LogLevel.h"
#define USE_NSLOGGER_LIB 1
#ifdef DEBUG
#ifdef USE_NSLOGGER_LIB
#include "LoggerClient.h"
#define LOG_NETWORK_DNS(level, ...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"network:dns",level,__VA_ARGS__)
#define LOG_NETWORK_DNS_VA(level, format, va_args) LogMessageF_va(__FILE__,__LINE__,__FUNCTION__,@"network:dns",level, format, va_args)
#define LOG_NETWORK_SOCKS(level, ...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"network:socks",level,__VA_ARGS__)
#define LOG_NETWORK_HTTP(level, ...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"network:http",level,__VA_ARGS__)
#define LOG_GENERAL(level, ...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"general",level,__VA_ARGS__)
#define LOG_GRAPHICS(level, ...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"graphics",level,__VA_ARGS__)
#else
#define LOG_NETWORK_DNS(level, ...) NSLog(__VA_ARGS__)
#define LOG_NETWORK_DNS_VA(level, format, va_args) NSLogv(format, va_args)
#define LOG_NETWORK_SOCKS(level, ...) NSLog(__VA_ARGS__)
#define LOG_NETWORK_HTTP(level, ...) NSLog(__VA_ARGS__)
#define LOG_GENERAL(level, ...) NSLog(__VA_ARGS__)
#define LOG_GRAPHICS(level, ...) NSLog(__VA_ARGS__)
#endif
#else
#define LOG_NETWORK_DNS(...) do{}while(0)
#define LOG_NETWORK_DNS_VA(level, format, va_args) do{}while(0)
#define LOG_NETWORK_SOCKS(...) do{}while(0)
#define LOG_NETWORK_HTTP(...) do{}while(0)
#define LOG_GENERAL(...) do{}while(0)
#define LOG_GRAPHICS(...) do{}while(0)
#endif
#if defined(DEBUG) && !defined(NDEBUG) && defined(USE_NSLOGGER_LIB)
#undef assert
#if __DARWIN_UNIX03
#define assert(e) \
(__builtin_expect(!(e), 0) ? (CFShow(CFSTR("assert going to fail, connect NSLogger NOW\n")), LoggerFlush(NULL,YES), __assert_rtn(__func__, __FILE__, __LINE__, #e)) : (void)0)
#else
#define assert(e) \
(__builtin_expect(!(e), 0) ? (CFShow(CFSTR("assert going to fail, connect NSLogger NOW\n")), LoggerFlush(NULL,YES), __assert(#e, __FILE__, __LINE__)) : (void)0)
#endif
#endif