1 /* |
|
2 * Copyright (c) 2005, 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: This file defines logging macros |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef USBCLASSCHANGEUIPLUGINDEBUG_H |
|
20 #define USBCLASSCHANGEUIPLUGINDEBUG_H |
|
21 |
|
22 #ifdef _DEBUG |
|
23 |
|
24 #include <e32svr.h> |
|
25 #include <e32std.h> |
|
26 |
|
27 // =========================================================================== |
|
28 #ifdef __WINS__ // File logging for WINS |
|
29 // =========================================================================== |
|
30 #define FLOG(a) { FPrint(a); } |
|
31 #define FTRACE(a) { a; } |
|
32 |
|
33 #include <f32file.h> |
|
34 #include <flogger.h> |
|
35 |
|
36 _LIT(KLogFile,"usbclasschangeuipluginlog.txt"); |
|
37 _LIT(KLogDir,"USBUI"); |
|
38 |
|
39 // Declare the FPrint function |
|
40 inline void FPrint(const TRefByValue<const TDesC> aFmt, ...) |
|
41 { |
|
42 VA_LIST list; |
|
43 VA_START(list,aFmt); |
|
44 RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, |
|
45 aFmt, list); |
|
46 } |
|
47 |
|
48 // =========================================================================== |
|
49 #else // RDebug logging for target HW |
|
50 // =========================================================================== |
|
51 #define FLOG(a) { RDebug::Print(a); } |
|
52 #define FTRACE(a) { a; } |
|
53 |
|
54 inline void FPrint(const TRefByValue<const TDesC16> aFmt, ...) |
|
55 { |
|
56 VA_LIST list; |
|
57 VA_START(list,aFmt); |
|
58 TInt tmpInt = VA_ARG(list, TInt); |
|
59 TInt tmpInt2 = VA_ARG(list, TInt); |
|
60 TInt tmpInt3 = VA_ARG(list, TInt); |
|
61 VA_END(list); |
|
62 RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); |
|
63 } |
|
64 |
|
65 inline void FPrint(TRefByValue<const TDesC8> aFmt, ...) |
|
66 { |
|
67 |
|
68 VA_LIST list; |
|
69 VA_START(list, aFmt); |
|
70 TBuf8<256> buf8; |
|
71 buf8.AppendFormatList(aFmt, list); |
|
72 |
|
73 TBuf16<256> buf16(buf8.Length()); |
|
74 buf16.Copy(buf8); |
|
75 |
|
76 TRefByValue<const TDesC> tmpFmt(_L("%S")); |
|
77 RDebug::Print(tmpFmt, &buf16); |
|
78 } |
|
79 |
|
80 #endif //__WINS__ |
|
81 |
|
82 // =========================================================================== |
|
83 #else // // No loggings --> Reduced binary size |
|
84 // =========================================================================== |
|
85 #define FLOG(a) |
|
86 #define FTRACE(a) |
|
87 |
|
88 #endif // _DEBUG |
|
89 |
|
90 |
|
91 #endif // USBCLASSCHANGEUIPLUGINDEBUG_H |
|
92 |
|
93 // End of File |
|