|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Class to handle output from the test harness. All output goes to the log file, |
|
15 // but screen output can be more controlled. |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalTechnology |
|
22 */ |
|
23 |
|
24 #ifndef __TOCSP_LOGGER_H__ |
|
25 #define __TOCSP_LOGGER_H__ |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <f32file.h> |
|
29 |
|
30 /** |
|
31 * This class provides a logging functionality. It logs everything in a file |
|
32 * and optionally displays it on the console. |
|
33 */ |
|
34 class CTOCSPLogger : public CBase |
|
35 { |
|
36 public: |
|
37 static CTOCSPLogger* NewLC(const TDesC& aLogFile); |
|
38 static CTOCSPLogger* NewL(const TDesC& aLogFile); |
|
39 ~CTOCSPLogger(); |
|
40 |
|
41 // Log to the file, and maybe echo to screen. |
|
42 // Sets echo mode from here on |
|
43 void LogL(const TDesC& aText, const TBool aEcho); |
|
44 void LogL(const TDesC8& aText, const TBool aEcho); |
|
45 void LogL(const TInt aInt, const TBool aEcho); |
|
46 |
|
47 // Log to file, and maybe to screen, depending on current echo mode |
|
48 void LogL(const TDesC& aText); |
|
49 void LogL(const TDesC8& aText); |
|
50 void LogL(const TInt aInt); |
|
51 void NewLineL(); |
|
52 |
|
53 // Prompt user and wait - only if echo is on |
|
54 void PressAnyKeyL(); |
|
55 |
|
56 private: |
|
57 void ConstructL(const TDesC& aLogFile); |
|
58 |
|
59 private: |
|
60 // We own the console |
|
61 CConsoleBase* iConsole; |
|
62 |
|
63 RFs iSession; |
|
64 RFile iFile; |
|
65 |
|
66 TBool iEcho; |
|
67 }; |
|
68 |
|
69 #endif // __TOCSP_LOGGER_H__ |