|
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 "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: This file contains the CPrintQueue and |
|
15 * CPrintQueueItem class definitions. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef LOGGINGDEFS_H |
|
20 #define LOGGINGDEFS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 |
|
26 |
|
27 // CONSTANTS |
|
28 const TUint KError = 0x1; |
|
29 const TUint KInit = 0x2; |
|
30 const TUint KThreadOperation = 0x4; |
|
31 const TUint KRunTestCase = 0x8; |
|
32 const TUint KPrint = 0x10; |
|
33 const TUint KMessage = 0x20; |
|
34 const TUint KVerbose = 0x40; |
|
35 const TUint KAlways = 0xFFFFFFFF; |
|
36 const TUint KDebugLevel = ( KMessage | KInit | KError ); |
|
37 |
|
38 // MACROS |
|
39 #define __TRACING_ENABLED |
|
40 |
|
41 // Define USE_RDEBUG to use RDebug::Print for logging |
|
42 //#define USE_RDEBUG |
|
43 |
|
44 // Define USE_LOGGER to use logger for logging |
|
45 #define USE_LOGGER |
|
46 |
|
47 #ifdef __TRACING_ENABLED |
|
48 |
|
49 // TRACE macro is used in server thread |
|
50 |
|
51 // Disable conditional expression is constant -warning |
|
52 #pragma warning( disable : 4127 ) |
|
53 |
|
54 // Using logger and not RDebug |
|
55 #if defined (USE_LOGGER) && !defined (USE_RDEBUG) |
|
56 #define __TRACE(level,p) if ( (level) & KDebugLevel) { ((CStifLogger*) Dll::Tls())->Log p; } |
|
57 #endif |
|
58 |
|
59 // Using RDebug and not Logger |
|
60 #if defined (USE_RDEBUG) && !defined (USE_LOGGER) |
|
61 #define __TRACE(level,p) if ( (level) & KDebugLevel) { RDebug::Print p; } |
|
62 #endif |
|
63 |
|
64 // Using Logger and RDebug |
|
65 #if defined (USE_RDEBUG) && defined (USE_LOGGER) |
|
66 #define __TRACE(level,p) if ( (level) & KDebugLevel) {\ |
|
67 ((CStifLogger*) Dll::Tls())->Log p;\ |
|
68 RDebug::Print p;\ |
|
69 } |
|
70 #endif |
|
71 |
|
72 // Not using RDebug and not using logger |
|
73 #if !defined(USE_RDEBUG) && !defined (USE_LOGGER) |
|
74 #define __TRACE(level,p); |
|
75 #endif |
|
76 |
|
77 #define __RDEBUG(x) if( KVerbose & KDebugLevel){ RDebug::Print x ; } |
|
78 |
|
79 #else |
|
80 // No tracing |
|
81 #define __TRACE(level,p); |
|
82 |
|
83 #define __RDEBUG(x) |
|
84 #endif |
|
85 |
|
86 |
|
87 // DATA TYPES |
|
88 |
|
89 // FUNCTION PROTOTYPES |
|
90 |
|
91 // FORWARD DECLARATIONS |
|
92 |
|
93 // CLASS DECLARATION |
|
94 |
|
95 #endif // LOGGINGDEFS_H |
|
96 |
|
97 // End of File |