|
1 /* |
|
2 * Copyright (c) 2004 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: Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __DEBUGLOG_H__ |
|
19 #define __DEBUGLOG_H__ |
|
20 |
|
21 #ifdef ENABLE_LOG_FILE |
|
22 |
|
23 #include <flogger.h> // RFileLogger |
|
24 #include <f32file.h> // RFs |
|
25 |
|
26 inline void WriteFormat( TRefByValue< const TDesC > aFormat, ... ) |
|
27 { |
|
28 _LIT( KTcLogDir, "TC" ); |
|
29 #ifndef LOG_NAME_DEFINED |
|
30 _LIT( KTcLogName, "TestClientDebug.log" ); |
|
31 #endif |
|
32 |
|
33 VA_LIST args; |
|
34 VA_START( args, aFormat ); |
|
35 RFileLogger::WriteFormat( KTcLogDir, KTcLogName, EFileLoggingModeAppend, |
|
36 aFormat, args ); |
|
37 VA_END( args ); |
|
38 } |
|
39 |
|
40 #define LOG WriteFormat |
|
41 #define RESETLOG ResetLog |
|
42 |
|
43 #define IF_LOG( statement ) statement |
|
44 |
|
45 #else // ENABLE_LOG_FILE |
|
46 |
|
47 #ifdef ENABLE_LOG_RDEBUG |
|
48 |
|
49 #include <e32svr.h> // RDebug |
|
50 #define LOG RDebug::Print |
|
51 #define IF_LOG( statement ) statement |
|
52 |
|
53 #else // ENABLE_LOG_RDEBUG |
|
54 |
|
55 inline void LOG( ... ) |
|
56 { |
|
57 } |
|
58 |
|
59 #define IF_LOG( statement ) |
|
60 |
|
61 #endif // ENABLE_LOG_RDEBUG |
|
62 |
|
63 inline void RESETLOG() |
|
64 { |
|
65 } |
|
66 |
|
67 #endif // ENABLE_LOG_FILE |
|
68 |
|
69 #endif // __DEBUGLOG_H__ |