equal
deleted
inserted
replaced
|
1 // Copyright (c) 2007-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 // ULogger File plugin header file |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 @prototype |
|
22 */ |
|
23 |
|
24 #ifndef ULOGGERFILEPLUGIN_H |
|
25 #define ULOGGERFILEPLUGIN_H |
|
26 |
|
27 #include "uloggeroutputplugin.h" // Ulogger::MOutputPlugin |
|
28 #include <f32file.h> // RFs |
|
29 |
|
30 |
|
31 namespace Ulogger |
|
32 { |
|
33 |
|
34 /** |
|
35 Settings keys for file plugin. |
|
36 */ |
|
37 _LIT(KOutputPath, "output_path"); |
|
38 _LIT(KLogDefaultFileName, "C:\\logs\\ulogger.log"); |
|
39 |
|
40 |
|
41 |
|
42 class CFileWriter : public CPlugin, public MOutputPlugin |
|
43 { |
|
44 public: |
|
45 static CFileWriter* NewL(); |
|
46 ~CFileWriter(); |
|
47 |
|
48 //from MOutputPlugin |
|
49 TInt ConfigureOutputPlugin(const RPointerArray<TPluginConfiguration>& aSettings); |
|
50 TInt Write(const TDesC8& aText); |
|
51 void CloseOutputPlugin(); |
|
52 |
|
53 //from CPublicBase |
|
54 TAny* GetInterfaceL(TPluginInterface aInterfaceId); |
|
55 |
|
56 private: |
|
57 CFileWriter(); |
|
58 void ConstructL(); |
|
59 TInt WriteToFile(const TDesC8& aText); |
|
60 TInt OpenLog(); |
|
61 |
|
62 private: |
|
63 RFs iFs; |
|
64 RFile iLog; |
|
65 TFileName iFileName; |
|
66 TBool iIsOpen; |
|
67 RMutex* iMutex; |
|
68 }; |
|
69 |
|
70 } // namespace |
|
71 |
|
72 #endif // ULOGGERFILEPLUGIN_H |