diff -r d45095c2f4f3 -r bee149131e4b mmappcomponents/videoplaylistutility/inc/videoplaylistutility_log.h --- a/mmappcomponents/videoplaylistutility/inc/videoplaylistutility_log.h Tue Feb 02 00:27:58 2010 +0200 +++ b/mmappcomponents/videoplaylistutility/inc/videoplaylistutility_log.h Fri Feb 19 23:18:32 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 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" @@ -15,130 +15,106 @@ * */ -// Version : %version: 2 % - - +// Version : %version: 3 % #ifndef VIDEOPLAYLISTUTILITY_LOG_H #define VIDEOPLAYLISTUTILITY_LOG_H + // INCLUDES #include #include #include #include -#include #include - -// #define _VPU_FILE_LOGGING_ - +// +// MACROS +// #ifdef _DEBUG - #define VPU_DEBUG RDebug::Print + #define VIDEOPLAYLISTUTILITY_DEBUG TVideoPlaylistUtilityLog::VideoPlaylistUtilityLog + #define VIDEOPLAYLISTUTILITY_ENTER_EXIT TEnterExitLog _s #else - #ifdef _VPU_FILE_LOGGING_ - #define VPU_DEBUG VideoPlaylistUtilityDebug::FileLog - #else - #define VPU_DEBUG RDebug::Print - #endif -#endif + #define VIDEOPLAYLISTUTILITY_DEBUG TVideoPlaylistUtilityLog::NullLog + #define VIDEOPLAYLISTUTILITY_ENTER_EXIT TVideoPlaylistUtilityLog::NullLog +#endif -class VideoPlaylistUtilityDebug +class TVideoPlaylistUtilityLog : public TDes16Overflow { public: + inline static void NullLog( TRefByValue /*aFmt*/, ... ) { } - inline static void FileLog( TRefByValue aFmt, ... ) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat( _L("VideoPlaylistUtility"), - _L("videoplaylistutility.log"), - EFileLoggingModeAppend, - aFmt, - list ); - } -}; - - - -// MACROS -#define VIDEOPLAYLISTUTILITY_DEBUG TVideoPlaylistUtilityLog::VideoPlaylistUtilityLog -#define VIDEOPLAYLISTUTILITY_ENTER_EXIT TEnterExitLog _s - -class TVideoPlaylistUtilityLog : public TDes16Overflow -{ - public: - inline static void VideoPlaylistUtilityLog( TRefByValue aFmt, ... ) { TBuf< 512 > buffer; - + VA_LIST list; VA_START( list, aFmt ); buffer.AppendFormatList( aFmt, list ); VA_END(list); - - VPU_DEBUG(_L("#VideoPlaylistUtility# %S"), &buffer ); + + RDebug::Print(_L("#VideoPlaylistUtility# %S"), &buffer ); } }; class TEnterExitLog : public TDes16Overflow { public: - + void Overflow(TDes16& /*aDes*/) { - VPU_DEBUG(_L("%S Logging Overflow"), &iFunctionName); + RDebug::Print(_L("%S Logging Overflow"), &iFunctionName); } TEnterExitLog( TRefByValue aFunctionName, TRefByValue aFmt, ... ) { iFunctionName = HBufC::New( TDesC(aFunctionName).Length() ); - + if ( iFunctionName ) { iFunctionName->Des().Copy(aFunctionName); } - + TBuf< 512 > buffer; - + VA_LIST list; VA_START( list, aFmt ); buffer.AppendFormatList( aFmt, list, this ); VA_END(list); - - VPU_DEBUG(_L("#VideoPlaylistUtility# --> %S %S"), iFunctionName, &buffer ); + + RDebug::Print(_L("#VideoPlaylistUtility# --> %S %S"), iFunctionName, &buffer ); } - + TEnterExitLog( TRefByValue aFunctionName ) { iFunctionName = HBufC::New( TDesC(aFunctionName).Length() ); - + if ( iFunctionName ) { iFunctionName->Des().Copy(aFunctionName); } - - VPU_DEBUG(_L("#VideoPlaylistUtility# --> %S"), iFunctionName ); + + RDebug::Print(_L("#VideoPlaylistUtility# --> %S"), iFunctionName ); } - + ~TEnterExitLog() { - VPU_DEBUG(_L("#VideoPlaylistUtility# <-- %S"), iFunctionName ); + RDebug::Print(_L("#VideoPlaylistUtility# <-- %S"), iFunctionName ); delete iFunctionName; } - + private: HBufC* iFunctionName; }; + _LIT(_KVPUErrorInfo, "#VideoPlaylistUtility# Error : error %d file %s line %d"); #define VIDEOPLAYLISTUTILITY_S(a) _S(a)