|
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: OMA Presence Settings Device Management Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef _PRESENCE_DM_LOGGER_H |
|
22 #define _PRESENCE_DM_LOGGER_H |
|
23 |
|
24 |
|
25 // logging is done only in debug |
|
26 #ifdef _DEBUG |
|
27 |
|
28 #include <flogger.h> |
|
29 |
|
30 //Logging constants |
|
31 _LIT(KPresDMLogDir, "presenceota"); |
|
32 _LIT(KPresDMLogFile, "presencedmlog.txt"); |
|
33 |
|
34 #define LOG_LIT(s) _L(s) |
|
35 #define LOG_LIT8(s) _L8(s) |
|
36 #define PRES_DM_LOG DebugWriteFormat |
|
37 |
|
38 |
|
39 /** |
|
40 * Log file printing utility function for presence DM |
|
41 * @since Series 60 3.2 |
|
42 */ |
|
43 inline void DebugWriteFormat( TRefByValue<const TDesC> aFmt,...) //lint !e960 |
|
44 { |
|
45 VA_LIST list; |
|
46 VA_START (list, aFmt); //lint !e960 |
|
47 TBuf< 300 > buffer; |
|
48 buffer.FormatList( aFmt, list ); |
|
49 RFileLogger::Write( KPresDMLogDir, KPresDMLogFile, EFileLoggingModeAppend, buffer ); |
|
50 } |
|
51 |
|
52 /** |
|
53 * Log file printing utility function for presence DM |
|
54 * @since Series 60 3.2 |
|
55 */ |
|
56 inline void DebugWriteFormat( TRefByValue<const TDesC8> aFmt,...) //lint !e960 |
|
57 { |
|
58 VA_LIST list; |
|
59 VA_START (list, aFmt); //lint !e960 |
|
60 TBuf8<300> buffer; |
|
61 buffer.FormatList( aFmt, list ); |
|
62 RFileLogger::Write( KPresDMLogDir, KPresDMLogFile, EFileLoggingModeAppend, buffer ); |
|
63 } |
|
64 |
|
65 #else // _DEBUG ( For Release code ) |
|
66 |
|
67 struct LogEmptyDebugString { }; |
|
68 |
|
69 #define LOG_LIT(s) LogEmptyDebugString() |
|
70 #define LOG_LIT8(s) LogEmptyDebugString() |
|
71 |
|
72 // Empty debug print functions for release builds. |
|
73 inline void PRES_DM_LOG(LogEmptyDebugString) |
|
74 { |
|
75 } |
|
76 |
|
77 template<class T1> |
|
78 inline void PRES_DM_LOG(LogEmptyDebugString,T1) |
|
79 { |
|
80 } |
|
81 |
|
82 template<class T1,class T2> |
|
83 inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2) |
|
84 { |
|
85 } |
|
86 |
|
87 template<class T1,class T2,class T3> |
|
88 inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3) |
|
89 { |
|
90 } |
|
91 |
|
92 template<class T1,class T2,class T3,class T4> |
|
93 inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4) |
|
94 { |
|
95 } |
|
96 |
|
97 template<class T1,class T2,class T3,class T4,class T5> |
|
98 inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5) |
|
99 { |
|
100 } |
|
101 |
|
102 template<class T1,class T2,class T3,class T4,class T5,class T6> |
|
103 inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6) |
|
104 { |
|
105 } |
|
106 |
|
107 template<class T1,class T2,class T3,class T4,class T5,class T6,class T7> |
|
108 inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6,T7) |
|
109 { |
|
110 } |
|
111 |
|
112 template<class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8> |
|
113 inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6,T7,T8) |
|
114 { |
|
115 } |
|
116 |
|
117 #endif // _DEBUG |
|
118 |
|
119 |
|
120 #endif // _PRESENCE_DM_LOGGER_H |
|
121 |
|
122 // End of File |