diff -r 085f765766a0 -r 860cd8a5168c imservices/ossprotocoladaptation/src/ossprotocolpluginlogger.cpp --- a/imservices/ossprotocoladaptation/src/ossprotocolpluginlogger.cpp Fri May 28 18:27:27 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Logger implementation -* -*/ - -// INCLUDE FILES - -#include -#include -#include - -#include "ossprotocolpluginlogger.h" - - -/** - * Handler used by logger to truncate the string - * rather than panic in case of buffer overflow. -*/ - -NONSHARABLE_CLASS ( TAdaptOverflowTruncate ) : public TDes16Overflow - { - -public: - void Overflow ( TDes16& /*aDes*/ ) {} - }; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// TLogger::WriteLog() -// ----------------------------------------------------------------------------- -// -void TLogger::WriteLog ( TRefByValue aFmt, ... ) - { -#ifdef ENABLE_DEBUG_LOGS - ( void ) aFmt;//Suppress unused formal parameter warning - TBuf< KTAdaptMaxLogLineLength > buffer; - buffer.Append ( _L ( "[" ) ); // CSI: 78 # - buffer.Append ( RThread().Name() ); - buffer.Append ( _L ( "] " ) ); // CSI: 78 # - TAdaptOverflowTruncate overflow; - VA_LIST list; - VA_START ( list, aFmt ); - buffer.AppendFormatList ( aFmt, list, &overflow ); - RFileLogger logger; - - if ( logger.Connect() == KErrNone ) - { - logger.SetDateAndTime ( ETrue, ETrue ); - logger.CreateLog ( KTAdaptDebugOutputDir, KTAdaptDebugOutputFileName, - EFileLoggingModeAppend ); - logger.Write ( buffer ); - logger.CloseLog(); - logger.Close(); - } - -#endif - - } - - - - - - -// End of File - -