networkcontrol/pfqoslib/inc/pfqosliblog.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2005-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 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @internalComponent
       
    20 */
       
    21 #if !defined(__LOG_H__)
       
    22 #define __LOG_H__
       
    23 
       
    24 #if !defined(_DEBUG)
       
    25 #  define LOG(a)
       
    26 #else
       
    27 #  define LOG(a) a 
       
    28 #  define _LOG
       
    29 
       
    30 #include <flogger.h>
       
    31 
       
    32 _LIT(KPfQosLibLogFolder,"pfqoslib");
       
    33 _LIT(KPfQosLibLogFile,"pfqoslib.txt");  
       
    34 
       
    35 class Log
       
    36 	{
       
    37 public:
       
    38 	static inline void Write(const TDesC& aDes);
       
    39 	static inline void Printf(TRefByValue<const TDesC> aFmt, ...);
       
    40 	static inline void Printf(TRefByValue<const TDesC8> aFmt, ...);
       
    41 	static inline void HexDump(const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen);
       
    42 	};
       
    43 
       
    44 inline void Log::Write(const TDesC& aDes)
       
    45 {
       
    46 	RFileLogger::Write(KPfQosLibLogFolder(), KPfQosLibLogFile(), EFileLoggingModeAppend, aDes);
       
    47 }
       
    48 	
       
    49 
       
    50 inline void Log::Printf(TRefByValue<const TDesC> aFmt, ...)
       
    51 {
       
    52 	VA_LIST list;
       
    53 	VA_START(list,aFmt);
       
    54 	RFileLogger::WriteFormat(KPfQosLibLogFolder(), KPfQosLibLogFile(), EFileLoggingModeAppend, aFmt, list);
       
    55 }
       
    56 
       
    57 inline void Log::Printf(TRefByValue<const TDesC8> aFmt, ...)
       
    58 {
       
    59 	VA_LIST list;
       
    60 	VA_START(list,aFmt);
       
    61 	RFileLogger::WriteFormat(KPfQosLibLogFolder(), KPfQosLibLogFile(), EFileLoggingModeAppend, aFmt, list);
       
    62 }
       
    63 
       
    64 inline void Log::HexDump(const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen)
       
    65 {
       
    66 	RFileLogger::HexDump(KPfQosLibLogFolder(), KPfQosLibLogFile(), EFileLoggingModeAppend, aHeader, aMargin, aPtr, aLen);
       
    67 }
       
    68 
       
    69 #endif // !defined(_DEBUG)
       
    70 
       
    71 #endif //__LOG_H__