Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/Config.h

Issue 5747779603267584: Issue #1234 - Rework strings in debug facility (Closed)
Patch Set: Created Feb. 24, 2015, 2:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 #ifndef _CONFIG_H 18 #ifndef _CONFIG_H
19 #define _CONFIG_H 19 #define _CONFIG_H
20 20
21 #define TIMER_THREAD_SLEEP_TAB_LOOP 10000 21 #define TIMER_THREAD_SLEEP_TAB_LOOP 10000
22 22
23 // Should we to on debug information 23 // Should we to on debug information
24 #ifdef _DEBUG 24 #ifdef _DEBUG
25 #define ENABLE_DEBUG_INFO 25 #define ENABLE_DEBUG_INFO
26 #define ENABLE_DEBUG_GENERAL 26 #define ENABLE_DEBUG_GENERAL
27 #define ENABLE_DEBUG_ERROR 27 #define ENABLE_DEBUG_ERROR
28 #undef ENABLE_DEBUG_BLOCKER
29 #undef ENABLE_DEBUG_FILTER
30 #undef ENABLE_DEBUG_SETTINGS
31 #undef ENABLE_DEBUG_THREAD
32 #undef ENABLE_DEBUG_NAVI
33 #undef ENABLE_DEBUG_DICTIONARY
34 #undef ENABLE_DEBUG_CHECKSUM
35 #undef ENABLE_DEBUG_INI
36 #undef ENABLE_DEBUG_MUTEX
37 #undef ENABLE_DEBUG_HIDE_EL
38 #undef ENABLE_DEBUG_WHITELIST
39 28
40 #define ENABLE_DEBUG_RESULT 29 #define ENABLE_DEBUG_RESULT
41 #define ENABLE_DEBUG_RESULT_IGNORED 30 #define ENABLE_DEBUG_RESULT_IGNORED
42 #define ENABLE_DEBUG_SPLIT_FILE 31 #define ENABLE_DEBUG_SPLIT_FILE
43 #else 32 #else
44 #undef ENABLE_DEBUG_INFO 33 #undef ENABLE_DEBUG_INFO
45 #endif 34 #endif
46 35
47 #ifdef NDEBUG 36 #ifdef NDEBUG
48 #undef ENABLE_DEBUG_INFO 37 #undef ENABLE_DEBUG_INFO
49 #endif 38 #endif
50 39
51 #undef ENABLE_DEBUG_SELFTEST 40 #undef ENABLE_DEBUG_SELFTEST
52 41
53 #define DEBUG_FUNC CPluginDebug::Debug 42 #define DEBUG_FUNC CPluginDebug::Debug
54 #define DEBUG_ERROR_FUNC CPluginDebug::DebugError
55 #define DEBUG_ERROR_CODE_FUNC CPluginDebug::DebugErrorCode
56 43
57 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_GENERAL) 44 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_GENERAL)
58 #undef DEBUG_GENERAL
59 #define DEBUG_GENERAL(x) DEBUG_FUNC(x); 45 #define DEBUG_GENERAL(x) DEBUG_FUNC(x);
60 #endif 46 #else
61 47 #define DEBUG_GENERAL(x)
62 #if (defined ENABLE_DEBUG_INFO)
63 #undef DEBUG
64 #define DEBUG(x) DEBUG_FUNC(x);
65 #endif
66
67 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_BLOCKER)
68 #undef DEBUG_BLOCKER
69 #define DEBUG_BLOCKER(x) DEBUG_FUNC(x);
70 #endif 48 #endif
71 49
72 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_FILTER) 50 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_FILTER)
73 #undef DEBUG_FILTER
74 #define DEBUG_FILTER(x) DEBUG_FUNC(x); 51 #define DEBUG_FILTER(x) DEBUG_FUNC(x);
52 #else
53 #define DEBUG_FILTER(x)
75 #endif 54 #endif
76 55
77 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_SETTINGS) 56 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_SETTINGS)
78 #undef DEBUG_SETTINGS
79 #define DEBUG_SETTINGS(x) DEBUG_FUNC(x); 57 #define DEBUG_SETTINGS(x) DEBUG_FUNC(x);
58 #else
59 #define DEBUG_SETTINGS(x)
80 #endif 60 #endif
81 61
82 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_THREAD) 62 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_THREAD)
83 #undef DEBUG_THREAD
84 #define DEBUG_THREAD(x) DEBUG_FUNC(x); 63 #define DEBUG_THREAD(x) DEBUG_FUNC(x);
64 #else
65 #define DEBUG_THREAD(x)
85 #endif 66 #endif
86 67
87 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_NAVI) 68 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_NAVI)
88 #undef DEBUG_NAVI
89 #define DEBUG_NAVI(x) DEBUG_FUNC(x); 69 #define DEBUG_NAVI(x) DEBUG_FUNC(x);
90 #endif 70 #else
91 71 #define DEBUG_NAVI(x)
92 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_CHECKSUM)
93 #undef DEBUG_CHECKSUM
94 #define DEBUG_CHECKSUM(x) DEBUG_FUNC(x);
95 #endif
96
97 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_DICTIONARY)
98 #undef DEBUG_DICTIONARY
99 #define DEBUG_DICTIONARY(x) DEBUG_FUNC(x);
100 #endif
101
102 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_INI)
103 #undef DEBUG_INI
104 #define DEBUG_INI(x) DEBUG_FUNC(x);
105 #endif 72 #endif
106 73
107 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_MUTEX) 74 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_MUTEX)
108 #undef DEBUG_MUTEX
109 #define DEBUG_MUTEX(x) DEBUG_FUNC(x); 75 #define DEBUG_MUTEX(x) DEBUG_FUNC(x);
76 #else
77 #define DEBUG_MUTEX(x)
110 #endif 78 #endif
111 79
112 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_HIDE_EL) 80 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_HIDE_EL)
113 #undef DEBUG_HIDE_EL
114 #define DEBUG_HIDE_EL(x) DEBUG_FUNC(x); 81 #define DEBUG_HIDE_EL(x) DEBUG_FUNC(x);
115 #endif 82 #else
116 83 #define DEBUG_HIDE_EL(x)
117 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_WHITELIST)
118 #undef DEBUG_WHITELIST
119 #define DEBUG_WHITELIST(x) DEBUG_FUNC(x);
120 #endif 84 #endif
121 85
122 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_ERROR) 86 #if (defined ENABLE_DEBUG_INFO && defined ENABLE_DEBUG_ERROR)
123 #undef DEBUG_ERROR 87 #define DEBUG_EXCEPTION(x) CPluginDebug::DebugException(x)
124 #define DEBUG_ERROR(x) DEBUG_ERROR_FUNC("!!! Error:" + CString(x)); 88 #define DEBUG_ERROR_CODE(err, x) CPluginDebug::DebugErrorCode(err, x);
125 #undef DEBUG_ERROR_CODE 89 #define DEBUG_ERROR_CODE_EX(err, x, process, thread) CPluginDebug::DebugErrorCod e(err, x, process, thread);
126 #define DEBUG_ERROR_CODE(err, x) DEBUG_ERROR_CODE_FUNC(err, "!!! Error:" + CStri ng(x)); 90 #else
127 #undef DEBUG_ERROR_CODE_EX 91 #define DEBUG_EXCEPTION(x)
128 #define DEBUG_ERROR_CODE_EX(err, x, process, thread) DEBUG_ERROR_CODE_FUNC(err, "!!! Error:" + CString(x), process, thread); 92 #define DEBUG_ERROR_CODE(err, x)
93 #define DEBUG_ERROR_CODE_EX(err, x, process, thread)
129 #endif 94 #endif
130 95
131 #undef DEBUG_ERROR_LOG 96 #define DEBUG_ERROR_LOG(err, id, subid, description) CPluginClientBase::PostPlug inError(err, id, subid, description);
sergei 2015/02/25 13:53:31 Why is it changed from Log to Post?
Eric 2015/02/25 15:24:46 The change is both a clarification and an optimiza
sergei 2015/02/25 15:51:23 Clear. However, I would say that impl of `CPluginC
Eric 2015/02/25 16:14:00 Yes, I agree. The sense of 'isAsync' is backwards.
132 #define DEBUG_ERROR_LOG(err, id, subid, description) CPluginClient::LogPluginErr or(err, id, subid, description); 97 #define DEBUG_SYSTEM_EXCEPTION(ex, id, subid, description) CPluginDebug::DebugSy stemException(ex, id, subid, description)
98 #define DEBUG_SELFTEST(x)
133 99
134 // ---------------------------------------------------------------------------- 100 // ----------------------------------------------------------------------------
135 // Miscellaneous 101 // Miscellaneous
136 // ---------------------------------------------------------------------------- 102 // ----------------------------------------------------------------------------
137 103
138 //For debugging production build
139 //#define ENABLE_DEBUG_INFO
140
141 // If defined, we will surround most of the methods with try catch
142 #undef CATCHALL
143
144 // If defined, we will throw exceptions for errors
145 // Otherwise we will try to handle it in a silent way, and only report
146 #undef THROW_ON_ERROR
147
148 // Status bar pane name 104 // Status bar pane name
149 #define STATUSBAR_PANE_NAME L"AdblockPlusStatusBarPane" 105 #define STATUSBAR_PANE_NAME L"AdblockPlusStatusBarPane"
150 106
151 // Status bar pane number 107 // Status bar pane number
152 #define STATUSBAR_PANE_NUMBER 2 108 #define STATUSBAR_PANE_NUMBER 2
153 109
154 #define ENGINE_STARTUP_TIMEOUT 10000 110 #define ENGINE_STARTUP_TIMEOUT 10000
155 111
156 112
157 113
158 #endif // _CONFIG_H 114 #endif // _CONFIG_H
OLDNEW

Powered by Google App Engine
This is Rietveld