|
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: Utility for debug prints to file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_DEBUGLOGGER_H |
|
21 #define C_DEBUGLOGGER_H |
|
22 |
|
23 //file only included with one of these debug flags enabled. |
|
24 #if defined(TFXSERVER_TIME_LOG) || defined(WSSERVERDRAWER_TIME_LOG) |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <flogger.h> |
|
28 |
|
29 /** |
|
30 * Class that holds the data for one log entry, the data consists |
|
31 * of one string and up to 4 integers |
|
32 * |
|
33 * @since S60 3.2 |
|
34 */ |
|
35 NONSHARABLE_CLASS(CLogEntry) : public CBase |
|
36 { |
|
37 public: |
|
38 CLogEntry(const TDesC16& aMsg, TInt aNbrArg, TInt aArg1=0, TInt aArg2=0, TInt aArg3=0, TInt aArg4=0); |
|
39 ~CLogEntry(); |
|
40 |
|
41 //data |
|
42 HBufC16 *iMsg; |
|
43 TInt iNbrArgs; |
|
44 TInt iArg1,iArg2,iArg3,iArg4; |
|
45 }; |
|
46 |
|
47 /** |
|
48 * Class that stores LogEntrys and later writes them to a file. |
|
49 * This can be used to get output on target without taking to much time. |
|
50 * |
|
51 * @since S60 3.2 |
|
52 */ |
|
53 NONSHARABLE_CLASS(CDebugLogger) : public CBase |
|
54 { |
|
55 public: |
|
56 CDebugLogger(); |
|
57 ~CDebugLogger(); |
|
58 void Log(const TDesC16& aMsg); |
|
59 void Log1(const TDesC16& aMsg, TInt aArg1); |
|
60 void Log2(const TDesC16& aMsg, TInt aArg1, TInt aArg2); |
|
61 void Log3(const TDesC16& aMsg, TInt aArg1, TInt aArg2, TInt aArg3); |
|
62 void Log4(const TDesC16& aMsg, TInt aArg1, TInt aArg2, TInt aArg3, TInt aArg4); |
|
63 void WriteToFile(const TDesC& aLogDir, const TDesC& aLogFile); |
|
64 TUint32 TimeMs(); |
|
65 private: //data |
|
66 RPointerArray<CLogEntry> iEntries; |
|
67 }; |
|
68 |
|
69 |
|
70 #endif // TFXSERVER_TIME_LOG |
|
71 |
|
72 #endif //C_DEBUGLOGGER_H |
|
73 |