|
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: ImumLogConfig.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IMUMLOGCONFIG_H |
|
20 #define IMUMLOGCONFIG_H |
|
21 |
|
22 |
|
23 #ifdef _DEBUG |
|
24 |
|
25 _LIT8(KImumLogBanner, _IMUM_LOG_BANNER ); |
|
26 _LIT8(KImumLogEnterFn, "-> %S"); |
|
27 _LIT8(KImumLogLeaveFn, "<- %S"); |
|
28 _LIT(KImumLogTimeFormatString, "%H:%T:%S:%*C2"); |
|
29 |
|
30 /** |
|
31 * @file |
|
32 * trace_utils.h contains definitions needed for advanced tracing features. |
|
33 * Tracing can be customized using the following compile time flags: |
|
34 * - <b>_DEBUG</b> |
|
35 * - With this flag undefined, all traces are disabled |
|
36 * - <b>__KERNEL_MODE__</b> |
|
37 * - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) |
|
38 * - <b>DISABLE_SYNTAX_CHECK</b> |
|
39 * - If this flag is defined, runtime syntax checking features are disabled from traces |
|
40 * - <b>DISABLE_GROUP_CHECKS</b> |
|
41 * - If this flag is defined, runtime group checking features are disabled from traces (API vs local traces, Ctx groups) |
|
42 */ |
|
43 |
|
44 |
|
45 #ifndef DISABLE_SYNTAX_CHECK |
|
46 #define _MARK_ENTRY() _dc.inOk=ETrue |
|
47 #define _DOINCHK() _dc.DoInChk() |
|
48 #define _CHK_MULTIIN() _dc.ChkMultiIn() |
|
49 #define _CHK_MULTIOUT() _dc.ChkMultiOut() |
|
50 #define _MARK_EXIT() _dc.outOk=ETrue |
|
51 #else |
|
52 #define _MARK_ENTRY() |
|
53 #define _DOINCHK() |
|
54 #define _CHK_MULTIIN() |
|
55 #define _CHK_MULTIOUT() |
|
56 #define _MARK_EXIT() |
|
57 #endif // DISABLE_SYNTAX_CHECK |
|
58 |
|
59 // #ifndef DISABLE_GROUP_CHECKS |
|
60 // #define _CHK_GRP() if ( (!TraceHeap::IsMaskOn(TRACENFO[_dc.iId].iGrpId)) || ((!_dc.iApi) && TraceHeap::IsApiOnly()) ) { break; } |
|
61 // #define _CREATE_MASK() TraceHeap::CreateL(CtxDefaultGroups) |
|
62 // #define _CHK_LEVEL(level) if ( TraceHeap::IsBelowLevel(level) ) { break; } |
|
63 // #else |
|
64 #define _CHK_GRP() |
|
65 #define _CREATE_MASK() |
|
66 #define _CHK_LEVEL(level) |
|
67 // #endif // DISABLE_GROUP_CHECKS |
|
68 |
|
69 /** For tracing */ |
|
70 #ifdef _IMUM_RDEBUG |
|
71 |
|
72 /* Includes */ |
|
73 #include <e32debug.h> |
|
74 |
|
75 #define _IT(a) (TPtrC((const TText *)(a))) |
|
76 #define _IMUMPRINTER RDebug::Print |
|
77 |
|
78 /** For filedebug */ |
|
79 #else // _IMUM_RDEBUG |
|
80 |
|
81 /** Includes */ |
|
82 #include <e32base.h> |
|
83 #include <e32std.h> |
|
84 #include <e32def.h> |
|
85 #include <e32svr.h> |
|
86 #include <flogger.h> |
|
87 _LIT( KImumLogPath, "Email" ); |
|
88 |
|
89 inline TBuf<30> LogFile( const TUint aThread, const TText* aText ) |
|
90 { |
|
91 TBuf<30> name; |
|
92 |
|
93 name.AppendNum( aThread, EHex ); |
|
94 name.Append( '-' ); |
|
95 name.Append( TPtrC( aText ) ); |
|
96 |
|
97 return name; |
|
98 } |
|
99 |
|
100 #define _IT(a) KImumLogPath, LogFile( _dc.iThdId, _dc.iFile ), EFileLoggingModeAppend, (TPtrC((const TText *)(a))) |
|
101 #define _IMUMPRINTER RFileLogger::WriteFormat |
|
102 #endif // _IMUM_RDEBUG |
|
103 |
|
104 #endif // _DEBUG |
|
105 |
|
106 #endif // IMUMLOGCONFIG_H |
|
107 |
|
108 |