|
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // TraceCore |
|
15 // |
|
16 |
|
17 #ifndef __TRACECOREDEBUG_H__ |
|
18 #define __TRACECOREDEBUG_H__ |
|
19 |
|
20 /** |
|
21 * Trace levels |
|
22 */ |
|
23 typedef enum |
|
24 { |
|
25 // Panics only |
|
26 ETraceLevelPanic, |
|
27 |
|
28 // Errors |
|
29 ETraceLevelError, |
|
30 |
|
31 // Warnings |
|
32 ETraceLevelWarning, |
|
33 |
|
34 // Normal traces |
|
35 ETraceLevelNormal, |
|
36 |
|
37 // Extra traces |
|
38 ETraceLevelExtra, |
|
39 |
|
40 // Flow traces |
|
41 ETraceLevelFlow, |
|
42 |
|
43 // Errors within trace functions |
|
44 ETraceLevelTraceError, |
|
45 |
|
46 // Flow within trace functions. Note that all BTrace calls throughout the system will |
|
47 // generate extra flow traces if this is set -> Slow... |
|
48 ETraceLevelTraceFlow, |
|
49 |
|
50 // All traces on |
|
51 ETraceLevelAll = KMaxTInt |
|
52 } TTraceLevel; |
|
53 |
|
54 /** |
|
55 * Compile-time trace level for TraceCore debug purposes |
|
56 */ |
|
57 #define TC_TRACE_LEVEL ETraceLevelError |
|
58 |
|
59 /** |
|
60 * Internal debug traces are on only in debug builds |
|
61 */ |
|
62 #ifdef _DEBUG |
|
63 #ifdef TC_TRACE_LEVEL |
|
64 #define TC_TRACE( level, trace ) /*lint -save -e506 -e522 -e774 -e834 -e960*/ { if ( level <= TC_TRACE_LEVEL ) { trace; } } /*lint -restore*//* CodForChk_Dis_LengthyLine */ |
|
65 #else |
|
66 #define TC_TRACE( level, trace ) {} |
|
67 #endif |
|
68 #else |
|
69 #define TC_TRACE( level, trace ) {} |
|
70 #endif // _DEBUG |
|
71 |
|
72 // When defined, POST code is printed out |
|
73 #define USE_POSTCODE |
|
74 |
|
75 #ifdef USE_POSTCODE |
|
76 #define POSTCODE( x ) {x} |
|
77 #else |
|
78 #define POSTCODE( x ) {} |
|
79 #endif |
|
80 |
|
81 |
|
82 #endif // __TRACECOREDEBUG_H__ |
|
83 |
|
84 // End of File |