2
|
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 module contains implementation of
|
|
15 |
* TDesLoggerOverflowHandler class member functions.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include <e32std.h>
|
|
21 |
#include "STFLoggerOverFlow.h"
|
|
22 |
#include "LoggerTracing.h"
|
|
23 |
|
|
24 |
/*
|
|
25 |
-------------------------------------------------------------------------------
|
|
26 |
|
|
27 |
Class: TDesLoggerOverflowHandler
|
|
28 |
|
|
29 |
Method: TDesLoggerOverflowHandler
|
|
30 |
|
|
31 |
Description: Default constructor
|
|
32 |
|
|
33 |
Parameters: CStifLoggerBase* aLogger: in: Pointer to CStifLoggerBase object
|
|
34 |
TInt aOverFlowSource: in: Over flow source
|
|
35 |
|
|
36 |
Return Values: None
|
|
37 |
|
|
38 |
Errors/Exceptions: None
|
|
39 |
|
|
40 |
Status: Approved
|
|
41 |
|
|
42 |
-------------------------------------------------------------------------------
|
|
43 |
*/
|
|
44 |
TDesSTFLoggerOverflowHandler::TDesSTFLoggerOverflowHandler(
|
|
45 |
RSTFLogger* aLogger, TInt aOverFlowSource)
|
|
46 |
{
|
|
47 |
iLogger = aLogger;
|
|
48 |
iOverFlowSource = aOverFlowSource;
|
|
49 |
|
|
50 |
}
|
|
51 |
|
|
52 |
/*
|
|
53 |
-------------------------------------------------------------------------------
|
|
54 |
|
|
55 |
Class: TDesLoggerOverflowHandler
|
|
56 |
|
|
57 |
Method: Overflow
|
|
58 |
|
|
59 |
Description: Simple overflow handling(16 bit)
|
|
60 |
|
|
61 |
Parameters: TDes16 &aDes: in: Reference to over flow data
|
|
62 |
|
|
63 |
Return Values: None
|
|
64 |
|
|
65 |
Errors/Exceptions: None
|
|
66 |
|
|
67 |
Status: Approved
|
|
68 |
|
|
69 |
-------------------------------------------------------------------------------
|
|
70 |
*/
|
|
71 |
void TDesSTFLoggerOverflowHandler::Overflow(TDes16& aDes)
|
|
72 |
{
|
|
73 |
__TRACE( KError, ( _L( "STIFLOGGER: Over flow" ) ) );
|
|
74 |
|
|
75 |
// If overflow
|
|
76 |
TInt len(0);
|
|
77 |
len = aDes.Length();
|
|
78 |
|
|
79 |
// const TInt to TInt avoiding warnings
|
|
80 |
TInt maxLogData = KMaxLogData;
|
|
81 |
TInt maxTestFileName = KMaxFileName;
|
|
82 |
|
|
83 |
// Overflow: Log() without aStyle or Log() with aStyle
|
|
84 |
if ((iOverFlowSource == 1 || iOverFlowSource == 2) && maxLogData > 60)
|
|
85 |
{
|
|
86 |
// Log overflow info if info is in allowed limits
|
|
87 |
aDes[len - 2] = 13; // 13 or '\' in Symbian OS
|
|
88 |
aDes[len - 1] = 10; // 10 or 'n' in Symbian OS
|
|
89 |
// ~60
|
|
90 |
iLogger->Log(0,
|
|
91 |
_L("Log() OVERFLOW: Check aLogInfo and KMaxLogData !!!"));
|
|
92 |
}
|
|
93 |
// Overflow: WriteDelimiter()
|
|
94 |
if (iOverFlowSource == 3 && maxLogData > 70)
|
|
95 |
{
|
|
96 |
// Log overflow info if info is in allowed limits, ~70
|
|
97 |
iLogger->Log(
|
|
98 |
0,
|
|
99 |
_L( "WriteDelimiter() OVERFLOW: Check delimiter and KMaxLogData !!!" ));
|
|
100 |
}
|
|
101 |
// Overflow: StartHtmlPage()
|
|
102 |
if (iOverFlowSource == 4 && maxTestFileName > 70)
|
|
103 |
{
|
|
104 |
// Log overflow info if info is in allowed limits, ~70
|
|
105 |
iLogger->Log(
|
|
106 |
0,
|
|
107 |
_L( "aTestFile OVERFLOW: Check aTestFile and KMaxFileName !!!" ));
|
|
108 |
}
|
|
109 |
|
|
110 |
}
|
|
111 |
|
|
112 |
/*
|
|
113 |
-------------------------------------------------------------------------------
|
|
114 |
|
|
115 |
Class: TDes8OverflowHandler
|
|
116 |
|
|
117 |
Method: TDes8LoggerOverflowHandler
|
|
118 |
|
|
119 |
Description: Default constructor
|
|
120 |
|
|
121 |
Parameters: CStifLoggerBase* aLogger: in: Pointer to CStifLoggerBase object
|
|
122 |
TInt aOverFlowSource: in: Over flow source
|
|
123 |
|
|
124 |
Return Values: None
|
|
125 |
|
|
126 |
Errors/Exceptions: None
|
|
127 |
|
|
128 |
Status: Approved
|
|
129 |
|
|
130 |
-------------------------------------------------------------------------------
|
|
131 |
*/
|
|
132 |
TDes8STFLoggerOverflowHandler::TDes8STFLoggerOverflowHandler(
|
|
133 |
RSTFLogger* aLogger, TInt aOverFlowSource)
|
|
134 |
{
|
|
135 |
iLogger = aLogger;
|
|
136 |
iOverFlowSource = aOverFlowSource;
|
|
137 |
|
|
138 |
}
|
|
139 |
|
|
140 |
/*
|
|
141 |
-------------------------------------------------------------------------------
|
|
142 |
|
|
143 |
Class: TDes8LoggerOverflowHandler
|
|
144 |
|
|
145 |
Method: Overflow
|
|
146 |
|
|
147 |
Description: Simple overflow handling(8 bit)
|
|
148 |
|
|
149 |
Parameters: TDes8 &aDes: in: Reference to over flow data
|
|
150 |
|
|
151 |
Return Values: None
|
|
152 |
|
|
153 |
Errors/Exceptions: None
|
|
154 |
|
|
155 |
Status: Approved
|
|
156 |
|
|
157 |
-------------------------------------------------------------------------------
|
|
158 |
*/
|
|
159 |
void TDes8STFLoggerOverflowHandler::Overflow(TDes8& aDes)
|
|
160 |
{
|
|
161 |
__TRACE( KError, ( _L( "STIFLOGGER: Over flow" ) ) );
|
|
162 |
|
|
163 |
// If overflow
|
|
164 |
TInt len(0);
|
|
165 |
len = aDes.Length();
|
|
166 |
|
|
167 |
// const TInt to TInt avoiding warnings
|
|
168 |
TInt maxLogData = KMaxLogData;
|
|
169 |
TInt maxTestFileName = KMaxFileName;
|
|
170 |
|
|
171 |
// Overflow: Log() without aStyle or Log() with aStyle
|
|
172 |
if ((iOverFlowSource == 1 || iOverFlowSource == 2) && maxLogData > 60)
|
|
173 |
{
|
|
174 |
// Log overflow info if info is in allowed limits
|
|
175 |
aDes[len - 2] = 13; // 13 or '\' in Symbian OS
|
|
176 |
aDes[len - 1] = 10; // 10 or 'n' in Symbian OS
|
|
177 |
// ~60
|
|
178 |
iLogger->Log(0,
|
|
179 |
_L("Log() OVERFLOW: Check aLogInfo and KMaxLogData !!!"));
|
|
180 |
}
|
|
181 |
// Overflow: WriteDelimiter()
|
|
182 |
if (iOverFlowSource == 3 && maxLogData > 70)
|
|
183 |
{
|
|
184 |
// Log overflow info if info is in allowed limits, ~70
|
|
185 |
iLogger->Log(
|
|
186 |
0,
|
|
187 |
_L( "WriteDelimiter() OVERFLOW: Check delimiter and KMaxLogData !!!" ));
|
|
188 |
}
|
|
189 |
// Overflow: StartHtmlPage()
|
|
190 |
if (iOverFlowSource == 4 && maxTestFileName > 70)
|
|
191 |
{
|
|
192 |
// Log overflow info if info is in allowed limits, ~70
|
|
193 |
iLogger->Log(
|
|
194 |
0,
|
|
195 |
_L( "aTestFile OVERFLOW: Check aTestFile and KMaxFileName !!!" ));
|
|
196 |
}
|
|
197 |
|
|
198 |
}
|
|
199 |
|
|
200 |
// End of File
|