tcpiputils/networkaddressandporttranslation/inc/naptlog.h
changeset 0 af10295192d8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tcpiputils/networkaddressandporttranslation/inc/naptlog.h	Tue Jan 26 15:23:49 2010 +0200
@@ -0,0 +1,73 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file 
+ @internalComponent
+ @prototype
+*/
+
+#if !defined(__NAPTLOG_H__)
+#define __NAPTLOG_H__
+
+#if !defined(_DEBUG) 
+#  define LOG(a)
+#else
+#  define LOG(a) a 
+#  define _LOG
+
+
+#include <comms-infras/commsdebugutility.h>
+
+_LIT(KNAPTLogFolder,"napt");
+_LIT(KNAPTLogFile,"napt.txt");  
+
+class Log
+	{
+public:
+	static inline void Write(const TDesC& aDes);
+	static inline void Printf(TRefByValue<const TDesC> aFmt, ...);
+	static inline void Printf(TRefByValue<const TDesC8> aFmt, ...);
+	static inline void HexDump(const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen);
+	};
+
+inline void Log::Write(const TDesC& aDes)
+{
+	RFileLogger::Write(KNAPTLogFolder(), KNAPTLogFile(), EFileLoggingModeAppend, aDes);
+}
+	
+
+inline void Log::Printf(TRefByValue<const TDesC> aFmt, ...)
+{
+	VA_LIST list;
+	VA_START(list,aFmt);
+	RFileLogger::WriteFormat(KNAPTLogFolder(), KNAPTLogFile(), EFileLoggingModeAppend, aFmt, list);
+}
+
+inline void Log::Printf(TRefByValue<const TDesC8> aFmt, ...)
+{
+	VA_LIST list;
+	VA_START(list,aFmt);
+	RFileLogger::WriteFormat(KNAPTLogFolder(), KNAPTLogFile(), EFileLoggingModeAppend, aFmt, list);
+}
+
+inline void Log::HexDump(const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen)
+{
+	RFileLogger::HexDump(KNAPTLogFolder(), KNAPTLogFile(), EFileLoggingModeAppend, aHeader, aMargin, aPtr, aLen);
+}
+
+#endif // 
+#endif //__NAPTLOG_H__
+