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 Logging macros for TestScripter. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef LOGGINGDEFS_H |
|
19 #define LOGGINGDEFS_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 |
|
25 |
|
26 // CONSTANTS |
|
27 const TUint KError = 0x1; |
|
28 const TUint KInit = 0x2; |
|
29 const TUint KPrint = 0x4; |
|
30 const TUint KMessage = 0x10; |
|
31 const TUint KFunction = 0x20; |
|
32 const TUint KVerbose = 0x40; |
|
33 const TUint KAlways = 0xFFFFFFFF; |
|
34 const TUint KDebugLevel = ( KPrint | KError | KMessage ); |
|
35 |
|
36 // MACROS |
|
37 #define __TRACING_ENABLED |
|
38 |
|
39 #ifdef __TRACING_ENABLED |
|
40 |
|
41 // Disable conditional expression is constant -warning |
|
42 #pragma warning( disable : 4127 ) |
|
43 |
|
44 // General tracing function |
|
45 #define __TRACE(level,p) if ( ( (level) & KDebugLevel ) && LOGGER )\ |
|
46 {LOGGER->Log p;} |
|
47 |
|
48 // Direct RDebug::Print |
|
49 #define __RDEBUG(p) if( KVerbose & KDebugLevel ){ RDebug::Print p ; } |
|
50 |
|
51 // Log function name |
|
52 #define __TRACEFUNC() if( ( KFunction & KDebugLevel ) && LOGGER ){\ |
|
53 const char* f = __FUNCTION__;\ |
|
54 TPtrC8 F((const unsigned char*)f);\ |
|
55 LOGGER->Log(F);} |
|
56 |
|
57 #else // __TRACING_ENABLED |
|
58 // No tracing |
|
59 #define __TRACE(level,p) |
|
60 #define __RDEBUG(p) |
|
61 #define __TRACEFUNC() |
|
62 #endif // __TRACING_ENABLED |
|
63 |
|
64 |
|
65 // DATA TYPES |
|
66 |
|
67 // FUNCTION PROTOTYPES |
|
68 |
|
69 // FORWARD DECLARATIONS |
|
70 |
|
71 // CLASS DECLARATION |
|
72 |
|
73 #endif // LOGGINGDEFS_H |
|
74 |
|
75 // End of File |
|