|
1 /* |
|
2 * Copyright (c) 2006 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: imps protocol adaptation . |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __IMPSDEBUGPRINT_H__ |
|
19 #define __IMPSDEBUGPRINT_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include "impsconfig.h" |
|
23 |
|
24 |
|
25 // ----------------------------------------------------------------------------- |
|
26 // Debug logging is enabled |
|
27 // ----------------------------------------------------------------------------- |
|
28 #ifdef IMPS_ENABLE_DEBUG_PRINT |
|
29 |
|
30 // INCLUDES |
|
31 #include "impslogger.h" |
|
32 |
|
33 // CONSTANTS |
|
34 _LIT( KIMPSDebugOutputDir, "IMPS" ); |
|
35 _LIT( KIMPSDebugOutputFileName, "IMPS2.log" ); |
|
36 const TInt KIMPSMaxLogLineLength = 250; |
|
37 |
|
38 |
|
39 // TARGET WARNING |
|
40 #ifndef _DEBUG |
|
41 #if defined(__VC32__) |
|
42 #pragma message( "Warning: IMPS Protocol Adapt debug printing _ON_" ) // CSI: 68 # |
|
43 #else // __GCC32__ |
|
44 #warning "IMPS Protocol Adapt printing _ON_" |
|
45 #endif // __VC32__ |
|
46 #endif |
|
47 |
|
48 |
|
49 // DEBUG PRINT INDIRECTION |
|
50 #define D_IMPS_LIT(s) _L(s) // CSI: 78 # |
|
51 #define IMPS_DP IMPSLogger::WriteLog |
|
52 #define IMPS_DP_TXT( s ) IMPSLogger::WriteLog( D_IMPS_LIT( s ) ) |
|
53 |
|
54 // DEBUG PRINTING IF FOR STATEMENTS |
|
55 #define IMPS_IF_DP( statement ) statement |
|
56 |
|
57 |
|
58 // TOKEN PASTING HELPERS FOR DEBUG PRINTING |
|
59 #define IMPS_STRINGIZE(l) L#l |
|
60 #define IMPS_TOKEN_PASTING(s) L##s |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 //----------------------------------------------------------------------------- |
|
66 // Empty implementations for non-debug printing builds. |
|
67 //----------------------------------------------------------------------------- |
|
68 #else |
|
69 // EMPTY DEBUG PRINTING IF |
|
70 #define IMPS_IF_DP( statement ) |
|
71 |
|
72 // DUMMY PARAMETER STRUCT |
|
73 struct TIMPSEmptyDebugString { }; |
|
74 |
|
75 |
|
76 // DEBUG PRINT INDIRECTION |
|
77 #define D_IMPS_LIT(s) TIMPSEmptyDebugString() |
|
78 #define IMPS_DP_TXT(s) IMPS_DP( D_IMPS_LIT(s) ) |
|
79 |
|
80 |
|
81 // EMPTY DEBUG PRINT FUNCTIONS |
|
82 inline void IMPS_DP( TIMPSEmptyDebugString ) |
|
83 { |
|
84 } |
|
85 |
|
86 template<class T1> |
|
87 inline void IMPS_DP( TIMPSEmptyDebugString, T1 ) |
|
88 { |
|
89 } |
|
90 |
|
91 template<class T1, class T2> |
|
92 inline void IMPS_DP( TIMPSEmptyDebugString, T1, T2 ) |
|
93 { |
|
94 } |
|
95 |
|
96 template<class T1, class T2, class T3> |
|
97 inline void IMPS_DP( TIMPSEmptyDebugString, T1, T2, T3 ) |
|
98 { |
|
99 } |
|
100 |
|
101 template<class T1, class T2, class T3, class T4> |
|
102 inline void IMPS_DP( TIMPSEmptyDebugString, T1, T2, T3, T4 ) |
|
103 { |
|
104 } |
|
105 |
|
106 template<class T1, class T2, class T3, class T4, class T5> |
|
107 inline void IMPS_DP( TIMPSEmptyDebugString, T1, T2, T3, T4, T5 ) |
|
108 { |
|
109 } |
|
110 |
|
111 template<class T1, class T2, class T3, class T4, class T5, class T6> |
|
112 inline void IMPS_DP( TIMPSEmptyDebugString, T1, T2, T3, T4, T5, T6 ) |
|
113 { |
|
114 } |
|
115 |
|
116 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7> |
|
117 inline void IMPS_DP( TIMPSEmptyDebugString, T1, T2, T3, T4, T5, T6, T7 ) |
|
118 { |
|
119 } |
|
120 |
|
121 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8> |
|
122 inline void IMPS_DP( TIMPSEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8 ) |
|
123 { |
|
124 } |
|
125 |
|
126 #endif // IMPS_ENABLE_DEBUG_PRINT |
|
127 |
|
128 |
|
129 #endif // __IMPSDEBUGPRINT_H__ |
|
130 |
|
131 // End of File |