|
1 /* |
|
2 * Copyright (c) 2009 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 the License "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef SA_COMMON_TRACE_H |
|
19 #define SA_COMMON_TRACE_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32svr.h> |
|
23 |
|
24 // PC-LINT OPTIONS |
|
25 // Removes null statement not in line by itself warnings from |
|
26 // COMPONENT_TRACE macros |
|
27 //lint -esym(960,54) |
|
28 |
|
29 // Removes "area too small" pointer cast warnings. |
|
30 //lint -e826 |
|
31 |
|
32 // CONSTANTS |
|
33 |
|
34 // MACROS |
|
35 |
|
36 #ifdef _DEBUG |
|
37 |
|
38 void BuildTraceFunc( const TDesC& aPrefix ); |
|
39 void AssertTraceFunc( const TDesC& aPrefix, const TDesC8& aFile, TInt aLine ); |
|
40 void DataDumpTraceFunc( const TDesC& aPrefix, const TDesC8& aData ); |
|
41 void IsiMsgApiTrace( const TDesC& aPrefix, const TDesC8& aData ); |
|
42 |
|
43 #define BUILD_TRACE( a ) BuildTraceFunc( a ) |
|
44 #define ASSERT_ALWAYS_TRACE( a ) AssertTraceFunc( a, _L8( __FILE__ ), __LINE__ ) |
|
45 #define ASSERT_TRACE( a, b) if( !b ) { ASSERT_ALWAYS_TRACE( a ); } |
|
46 |
|
47 #define ADD_QUOTES(in) #in |
|
48 #define BUILD_STRING(in) ADD_QUOTES(in) |
|
49 |
|
50 #ifdef API_TRACE_FLAG |
|
51 |
|
52 #define API_TRACE( a ) RDebug::Print a |
|
53 #define DATA_DUMP_TRACE( a, b ) DataDumpTraceFunc( a, b ) |
|
54 #define ISIMSG_API_TRACE( a, b ) IsiMsgApiTrace( a, b ) |
|
55 |
|
56 #else // API_TRACE_FLAG |
|
57 |
|
58 #define API_TRACE( a ) |
|
59 #define DATA_DUMP_TRACE( a, b ) |
|
60 #define ISIMSG_API_TRACE( a, b ) |
|
61 |
|
62 #endif // API_TRACE_FLAG |
|
63 |
|
64 #ifdef INTERNAL_TRACE_FLAG |
|
65 |
|
66 #define INTERNAL_TRACE( a ) RDebug::Print a |
|
67 |
|
68 #else // INTERNAL_TRACE_FLAG |
|
69 |
|
70 #define INTERNAL_TRACE( a ) |
|
71 |
|
72 #endif // INTERNAL_TRACE_FLAG |
|
73 |
|
74 #else // _DEBUG |
|
75 |
|
76 #define BUILD_TRACE( a ) |
|
77 #define ASSERT_TRACE( a, b) |
|
78 #define ASSERT_ALWAYS_TRACE( a ) |
|
79 #define API_TRACE( a ) |
|
80 #define INTERNAL_TRACE( a ) |
|
81 #define DATA_DUMP_TRACE( a, b ) |
|
82 #define ISIMSG_API_TRACE( a, b ) |
|
83 |
|
84 #endif // _DEBUG |
|
85 |
|
86 // DATA TYPES |
|
87 |
|
88 // FUNCTION PROTOTYPES |
|
89 |
|
90 // FORWARD DECLARATIONS |
|
91 |
|
92 #endif //SA_COMMON_TRACE_H |
|
93 |
|
94 // End of File |
|
95 |