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