diff -r 000000000000 -r dd21522fd290 codhandler/roapapp/src/RoapAppLogger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/codhandler/roapapp/src/RoapAppLogger.cpp Mon Mar 30 12:54:55 2009 +0300 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "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: +* Implementation of class RoapAppLogger. +* +* +*/ + + +// INCLUDE FILES + +#include "RoapAppLogger.h" +#include + +#ifdef __TEST_ROAP_APP_LOG + +// ================= CONSTANTS ======================= + +/// COD logging directory. +_LIT( KRoapAppLogDir, "ROAP" ); +/// COD log file name. +_LIT( KRoapAppLogFile, "RoapApp.txt" ); + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// RoapAppLogger::Write() +// --------------------------------------------------------- +// +void RoapAppLogger::Write +( TInt aLevel, TRefByValue aFmt, ... ) + { + if( aLevel <= ROAP_APP_LOG_LEVEL ) + { + VA_LIST list; + VA_START( list, aFmt ); + RFileLogger::WriteFormat + ( + KRoapAppLogDir, + KRoapAppLogFile, + EFileLoggingModeAppend, + aFmt, + list + ); + VA_END( list ); + } + } + +// --------------------------------------------------------- +// RoapAppLogger::Write() +// --------------------------------------------------------- +// +void RoapAppLogger::Write +( TInt aLevel, TRefByValue aFmt, VA_LIST& aList ) + { + if( aLevel <= ROAP_APP_LOG_LEVEL ) + { + RFileLogger::WriteFormat + ( + KRoapAppLogDir, + KRoapAppLogFile, + EFileLoggingModeAppend, + aFmt, + aList + ); + } + } + +// --------------------------------------------------------- +// RoapAppLogger::Write() +// --------------------------------------------------------- +// +void RoapAppLogger::Write +( TInt aLevel, TRefByValue aFmt, ... ) + { + if( aLevel <= ROAP_APP_LOG_LEVEL ) + { + VA_LIST list; + VA_START( list, aFmt ); + RFileLogger::WriteFormat + ( + KRoapAppLogDir, + KRoapAppLogFile, + EFileLoggingModeAppend, + aFmt, + list + ); + VA_END( list ); + } + } + +// --------------------------------------------------------- +// RoapAppLogger::Write() +// --------------------------------------------------------- +// +void RoapAppLogger::Write +( TInt aLevel, TRefByValue aFmt, VA_LIST& aList ) + { + if( aLevel <= ROAP_APP_LOG_LEVEL ) + { + RFileLogger::WriteFormat + ( + KRoapAppLogDir, + KRoapAppLogFile, + EFileLoggingModeAppend, + aFmt, + aList + ); + } + } + +// --------------------------------------------------------- +// RoapAppLogger::HexDump() +// --------------------------------------------------------- +// +void RoapAppLogger::HexDump + ( + TInt aLevel, + const TText* aHeader, + const TText* aMargin, + const TUint8* aPtr, + TInt aLen + ) + { + if( aLevel <= ROAP_APP_LOG_LEVEL ) + { + RFileLogger::HexDump + ( + KRoapAppLogDir, + KRoapAppLogFile, + EFileLoggingModeAppend, + aHeader, + aMargin, + aPtr, + aLen + ); + } + } + +#endif /* def __TEST_ROAP_APP_LOG */