|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: LocUtilsDebug contains debug macros. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef LOCUTILSDEBUG_H |
|
20 #define LOCUTILSDEBUG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "locutilsdebugconfig.hrh" |
|
24 |
|
25 #include <e32std.h> |
|
26 |
|
27 |
|
28 // MACROS |
|
29 #define DEBUG(TEXT) { \ |
|
30 _LIT( KText, #TEXT ); \ |
|
31 Debug(KText) \ |
|
32 } |
|
33 |
|
34 #define LOC(TEXT, ARG1) { \ |
|
35 _LIT( KText, #TEXT ); \ |
|
36 Debug( KText, (ARG1) ); \ |
|
37 } |
|
38 |
|
39 #define LOC2(TEXT, ARG1, ARG2) { \ |
|
40 _LIT( KText, #TEXT ); \ |
|
41 Debug( KText,(ARG1), (ARG2) ); \ |
|
42 } |
|
43 |
|
44 #define LOC3(TEXT, ARG1, ARG2, ARG3) { \ |
|
45 _LIT( KText, #TEXT ); \ |
|
46 Debug( KText, (ARG1), (ARG2), (ARG3) ); \ |
|
47 } |
|
48 |
|
49 IMPORT_C void Debug( TRefByValue<const TDesC> aText, ...); |
|
50 |
|
51 /** |
|
52 * By using component specific debug macros unnecessary |
|
53 * debug prints can be avoided. |
|
54 * Also component specific debugging is possible by compiling |
|
55 * only certain components when LOC_ENABLE_DEBUG_PRINT is defined. |
|
56 */ |
|
57 |
|
58 #ifdef LOC_ENABLE_DEBUG_PRINT |
|
59 |
|
60 #define LOCUTILSDEBUG(TEXT) DEBUG(TEXT); |
|
61 #define LOCUTILSDEBUG1(TEXT, ARG1) LOC(TEXT, ARG1); |
|
62 #define LOCUTILSDEBUG2(TEXT, ARG1, ARG2) LOC2(TEXT, ARG1, ARG2); |
|
63 #define LOCUTILSDEBUG3(TEXT, ARG1, ARG2, ARG3) LOC3(TEXT, ARG1, ARG2, ARG3); |
|
64 |
|
65 #else |
|
66 |
|
67 #define LOCUTILSDEBUG(TEXT) ; |
|
68 #define LOCUTILSDEBUG1(TEXT, ARG1) ; |
|
69 #define LOCUTILSDEBUG2(TEXT, ARG1, ARG2) ; |
|
70 #define LOCUTILSDEBUG3(TEXT, ARG1, ARG2, ARG3) ; |
|
71 |
|
72 #endif |
|
73 |
|
74 #endif // LOCUTILSDEBUG_H |