|
1 /* |
|
2 * Copyright (c) 2005-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 "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 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalTechnology |
|
24 */ |
|
25 |
|
26 #ifndef HWRMTRACE_H |
|
27 #define HWRMTRACE_H |
|
28 |
|
29 |
|
30 #include <e32svr.h> |
|
31 #include <comms-infras/commsdebugutility.h> |
|
32 |
|
33 //define this macro to force all logging off. Will require a rebuild after change. |
|
34 //#define FORCE_TRACE_OFF |
|
35 |
|
36 //define the macro to enable RDebug traces. |
|
37 //#define ENABLE_RDEBUG_TRACE |
|
38 |
|
39 #ifdef _DEBUG |
|
40 #ifndef FORCE_TRACE_OFF |
|
41 #ifndef DISABLE_COMPONENT_TRACE |
|
42 #define COMPONENT_TRACE_FLAG |
|
43 #endif //DISABLE_COMPONENT_TRACE |
|
44 #endif //FORCE_TRACE_OFF |
|
45 #endif //_DEBUG |
|
46 |
|
47 |
|
48 #ifdef COMPONENT_TRACE_FLAG |
|
49 |
|
50 _LIT8(KHwrmSubSystem, "HWRM"); |
|
51 |
|
52 #if defined HWRM_SERVER |
|
53 _LIT8(KHwrmCompnt, "Server"); |
|
54 #elif defined HWRM_CLIENT |
|
55 _LIT8(KHwrmCompnt, "Client"); |
|
56 #elif defined HWRM_COMMON |
|
57 _LIT8(KHwrmCompnt, "Common"); |
|
58 #elif defined HWRM_LIGHT |
|
59 _LIT8(KHwrmCompnt, "Light"); |
|
60 #elif defined HWRM_EXTENDED_LIGHT |
|
61 _LIT8(KHwrmCompnt, "ExtendedLight"); |
|
62 #elif defined HWRM_VIBRA |
|
63 _LIT8(KHwrmCompnt, "Vibra"); |
|
64 #elif defined HWRM_POWER |
|
65 _LIT8(KHwrmCompnt, "Power"); |
|
66 #elif defined HWRM_FMTX |
|
67 _LIT8(KHwrmCompnt, "FmTx"); |
|
68 #elif HWRM_TARGET_MOD_PLUGIN |
|
69 _LIT8(KHwrmCompnt, "TargetModPlugin"); |
|
70 #else |
|
71 _LIT8(KHwrmCompnt, "Unknown"); |
|
72 #endif |
|
73 |
|
74 |
|
75 #ifndef ENABLE_RDEBUG_TRACE |
|
76 //LOG Using CommsDebugUtility |
|
77 #define COMPONENT_TRACE1(A) __FLOG_STATIC0(KHwrmSubSystem,KHwrmCompnt,(A)) |
|
78 #define COMPONENT_TRACE2(A,B) __FLOG_STATIC1(KHwrmSubSystem,KHwrmCompnt,(A),(B)) |
|
79 #define COMPONENT_TRACE3(A,B,C) __FLOG_STATIC2(KHwrmSubSystem,KHwrmCompnt,(A),(B),(C)) |
|
80 #define COMPONENT_TRACE4(A,B,C,D) __FLOG_STATIC3(KHwrmSubSystem,KHwrmCompnt,(A),(B),(C),(D)) |
|
81 #define COMPONENT_TRACE5(A,B,C,D,E) __FLOG_STATIC4(KHwrmSubSystem,KHwrmCompnt,(A),(B),(C),(D),(E)) |
|
82 #define COMPONENT_TRACE6(A,B,C,D,E,F) __FLOG_STATIC5(KHwrmSubSystem,KHwrmCompnt,(A),(B),(C),(D),(E),(F)) |
|
83 #define COMPONENT_TRACE7(A,B,C,D,E,F,G) __FLOG_STATIC6(KHwrmSubSystem,KHwrmCompnt,(A),(B),(C),(D),(E),(F),(G)) |
|
84 #define COMPONENT_TRACE8(A,B,C,D,E,F,G,H) __FLOG_STATIC7(KHwrmSubSystem,KHwrmCompnt,(A),(B),(C),(D),(E),(F),(G),(H)) |
|
85 #define COMPONENT_TRACE9(A,B,C,D,E,F,G,H,I) __FLOG_STATIC8(KHwrmSubSystem,KHwrmCompnt,(A),(B),(C),(D),(E),(F),(G),(H), (I)) |
|
86 |
|
87 #else |
|
88 //LOG Using RDebug |
|
89 #define COMPONENT_TRACE1(A) RDebug::Print((A)) |
|
90 #define COMPONENT_TRACE2(A,B) RDebug::Print((A),(B)) |
|
91 #define COMPONENT_TRACE3(A,B,C) RDebug::Print((A),(B),(C)) |
|
92 #define COMPONENT_TRACE4(A,B,C,D) RDebug::Print((A),(B),(C),(D)) |
|
93 #define COMPONENT_TRACE5(A,B,C,D,E) RDebug::Print((A),(B),(C),(D),(E)) |
|
94 #define COMPONENT_TRACE6(A,B,C,D,E,F) RDebug::Print((A),(B),(C),(D),(E),(F)) |
|
95 #define COMPONENT_TRACE7(A,B,C,D,E,F,G) RDebug::Print((A),(B),(C),(D),(E),(F),(G)) |
|
96 #define COMPONENT_TRACE8(A,B,C,D,E,F,G,H) RDebug::Print((A),(B),(C),(D),(E),(F),(G),(H)) |
|
97 #define COMPONENT_TRACE9(A,B,C,D,E,F,G,H,I) RDebug::Print((A),(B),(C),(D),(E),(F),(G),(H), (I)) |
|
98 |
|
99 #endif //ENABLE_RDEBUG_TRACE |
|
100 |
|
101 |
|
102 #else // _DEBUG || DISABLE_COMPONENT_TRACE |
|
103 |
|
104 #define COMPONENT_TRACE1(A) |
|
105 #define COMPONENT_TRACE2(A,B) |
|
106 #define COMPONENT_TRACE3(A,B,C) |
|
107 #define COMPONENT_TRACE4(A,B,C,D) |
|
108 #define COMPONENT_TRACE5(A,B,C,D,E) |
|
109 #define COMPONENT_TRACE6(A,B,C,D,E,F) |
|
110 #define COMPONENT_TRACE7(A,B,C,D,E,F,G) |
|
111 #define COMPONENT_TRACE8(A,B,C,D,E,F,G,H) |
|
112 #define COMPONENT_TRACE9(A,B,C,D,E,F,G,H,I) |
|
113 |
|
114 |
|
115 #endif //COMPONENT_TRACE_FLAG |
|
116 |
|
117 #endif // HWRMTRACE_H |
|
118 |
|
119 |
|
120 // End of File |