|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * Macro definition file for logging. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef __MMCSCBKUPLOGGER_H__ |
|
21 #define __MMCSCBKUPLOGGER_H__ |
|
22 |
|
23 // System includes |
|
24 #include <e32std.h> |
|
25 |
|
26 // User includes |
|
27 #include "MMCScBkupConfig.h" |
|
28 #include "TMMCScBkupOwnerDataType.h" |
|
29 |
|
30 class MMCScBkupLogger |
|
31 { |
|
32 public: |
|
33 static void LogRaw( const TDesC& aData ); |
|
34 static void Log( TRefByValue<const TDesC> aFmt, ... ); |
|
35 static void LogFile( TRefByValue<const TDesC> aFmt, ... ); |
|
36 static const TDesC& DataType( TMMCScBkupOwnerDataType aType ); |
|
37 static const TDesC& FriendlyNameForSID( TSecureId aSID ); |
|
38 }; |
|
39 |
|
40 |
|
41 // Logging Macros |
|
42 #if defined(__MMCSCBKUPLOGGING_ENABLED__) |
|
43 |
|
44 _LIT( KMMCScBkupLoggingFullPath, "C:\\Logs\\MMCScBkup\\" ); |
|
45 |
|
46 #define __LOG(aFmt) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes); } |
|
47 #define __LOG1(aFmt, A) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes, A); } |
|
48 #define __LOG2(aFmt, A, B) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes, A, B); } |
|
49 #define __LOG3(aFmt, A, B, C) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes, A, B, C); } |
|
50 #define __LOG4(aFmt, A, B, C, D) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes, A, B, C, D); } |
|
51 #define __LOG5(aFmt, A, B, C, D, E) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes, A, B, C, D, E); } |
|
52 #define __LOG6(aFmt, A, B, C, D, E, F) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes, A, B, C, D, E, F); } |
|
53 #define __LOG7(aFmt, A, B, C, D, E, F, G) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes, A, B, C, D, E, F, G); } |
|
54 #define __LOG8(aFmt, A, B, C, D, E, F, G, H) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::Log(tempLogDes, A, B, C, D, E, F, G, H); } |
|
55 |
|
56 // Path for backup log containing possible errors encountered during backup |
|
57 // or restore. This is needed because all errors won't interrupt operation. |
|
58 _LIT( KMMCScBkupLoggingFullPathAndName, "C:\\Private\\101F84EB\\BURLog\\bur.txt" ); |
|
59 |
|
60 #define __LOGFILE(aFmt) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::LogFile(tempLogDes); } |
|
61 #define __LOGFILE1(aFmt, A) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::LogFile(tempLogDes, A); } |
|
62 #define __LOGFILE2(aFmt, A, B) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::LogFile(tempLogDes, A, B); } |
|
63 #define __LOGFILE3(aFmt, A, B, C) { _LIT(tempLogDes, aFmt); MMCScBkupLogger::LogFile(tempLogDes, A, B, C); } |
|
64 |
|
65 #else |
|
66 |
|
67 #define __LOG(aFmt) |
|
68 #define __LOG1(aFmt, A) |
|
69 #define __LOG2(aFmt, A, B) |
|
70 #define __LOG3(aFmt, A, B, C) |
|
71 #define __LOG4(aFmt, A, B, C, D) |
|
72 #define __LOG5(aFmt, A, B, C, D, E) |
|
73 #define __LOG6(aFmt, A, B, C, D, E, F) |
|
74 #define __LOG7(aFmt, A, B, C, D, E, F, G) |
|
75 #define __LOG8(aFmt, A, B, C, D, E, F, G, H) |
|
76 |
|
77 #define __LOGFILE(aFmt) |
|
78 #define __LOGFILE1(aFmt, A) |
|
79 #define __LOGFILE2(aFmt, A, B) |
|
80 #define __LOGFILE3(aFmt, A, B, C) |
|
81 |
|
82 #endif |
|
83 |
|
84 #endif // __MMCSCBKUPLOGGER_H__ |