First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 #ifndef __INULOGGER_H__
19 #define __INULOGGER_H__
26 //##ModelId=3A914DF60214
31 // Destructor - closes the log
32 //##ModelId=3A914DF60249
33 IMPORT_C ~TInuLogger();
35 // Create log file in directory KLogsdir\KWapLogsDirName - Note: ingore Drive and Path of aFilename
36 //##ModelId=3A914DF6023F
37 IMPORT_C void CreateFlogger(const TDesC& aFileName, TInt aShowDate, TInt aShowTime);
39 //##ModelId=3A914DF6023C
40 IMPORT_C void LogIt(TRefByValue<const TDesC> aFmt, ...);
42 // Writes aComment to test log file, logging file and test harness
43 //##ModelId=3A914DF60232
44 IMPORT_C void WriteComment(const TDesC& aComment);
46 // Do a formatted dump of binary data
47 //##ModelId=3A914DF6022B
48 IMPORT_C void DumpIt(const TDesC8& aData);
50 // Do a write of the supplied 8 bit data
51 //##ModelId=3A914DF60234
52 IMPORT_C void WriteComment(const TDesC8& aData);
54 private: // attributes
57 //##ModelId=3A914DF60228
61 // By default, logging will always be switched on. Later, this may be removed, leaving it to individual
62 // source files to enable logging where needed.
65 #if defined (_DEBUG) && defined (_LOGGING)
67 // HTTP Logging macros
68 #define __DECLARE_LOG TInuLogger iLogger;
69 #define __OPEN_LOG(L) iLogger.CreateFlogger(_L(L), ETrue, ETrue);
70 #define __OPEN_LOG2(L) iLogger.CreateFlogger(L, ETrue, ETrue);
71 #define __LOG(C) iLogger.WriteComment(C);
72 #define __LOG1(C, X) iLogger.LogIt(C, X);
73 #define __LOG2(C, X, Y) iLogger.LogIt(C, X, Y);
74 #define __LOG3(C, X, Y, Z) iLogger.LogIt(C, X, Y, Z);
75 #define __DUMPBIN(D) iLogger.DumpIt(D);
76 #define __QINFO(aText) {User::InfoPrint(aText); User::After(1000000);}
78 #else if !defined (_DEBUG)
83 #define __OPEN_LOG2(L)
86 #define __LOG2(C, X, Y)
87 #define __LOG3(C, X, Y, Z)
89 #define __QINFO(aText)
92 #endif // __InuLOGGER_H__