diff -r 000000000000 -r c8caa15ef882 simpleengine/presencedm/inc/presencedmlogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/simpleengine/presencedm/inc/presencedmlogger.h Tue Feb 02 01:05:17 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2006 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: OMA Presence Settings Device Management Adapter +* +*/ + + + + +#ifndef _PRESENCE_DM_LOGGER_H +#define _PRESENCE_DM_LOGGER_H + + +// logging is done only in debug +#ifdef _DEBUG + +#include + +//Logging constants +_LIT(KPresDMLogDir, "presenceota"); +_LIT(KPresDMLogFile, "presencedmlog.txt"); + +#define LOG_LIT(s) _L(s) +#define LOG_LIT8(s) _L8(s) +#define PRES_DM_LOG DebugWriteFormat + + +/** +* Log file printing utility function for presence DM +* @since Series 60 3.2 +*/ +inline void DebugWriteFormat( TRefByValue aFmt,...) //lint !e960 + { + VA_LIST list; + VA_START (list, aFmt); //lint !e960 + TBuf< 300 > buffer; + buffer.FormatList( aFmt, list ); + RFileLogger::Write( KPresDMLogDir, KPresDMLogFile, EFileLoggingModeAppend, buffer ); + } + +/** +* Log file printing utility function for presence DM +* @since Series 60 3.2 +*/ +inline void DebugWriteFormat( TRefByValue aFmt,...) //lint !e960 + { + VA_LIST list; + VA_START (list, aFmt); //lint !e960 + TBuf8<300> buffer; + buffer.FormatList( aFmt, list ); + RFileLogger::Write( KPresDMLogDir, KPresDMLogFile, EFileLoggingModeAppend, buffer ); + } + +#else // _DEBUG ( For Release code ) + +struct LogEmptyDebugString { }; + +#define LOG_LIT(s) LogEmptyDebugString() +#define LOG_LIT8(s) LogEmptyDebugString() + +// Empty debug print functions for release builds. +inline void PRES_DM_LOG(LogEmptyDebugString) + { + } + +template +inline void PRES_DM_LOG(LogEmptyDebugString,T1) + { + } + +template +inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2) + { + } + +template +inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3) + { + } + +template +inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4) + { + } + +template +inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5) + { + } + +template +inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6) + { + } + +template +inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6,T7) + { + } + +template +inline void PRES_DM_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6,T7,T8) + { + } + +#endif // _DEBUG + + +#endif // _PRESENCE_DM_LOGGER_H + +// End of File