diff -r 76f9aaeefbab -r e13acd883fbe common/tools/ats/smoketest/lbs/lbstestutils/src/ctdumper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/lbs/lbstestutils/src/ctdumper.cpp Tue Nov 10 13:50:58 2009 +0000 @@ -0,0 +1,69 @@ +// Copyright (c) 2007-2009 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 "Symbian Foundation License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include +#include + +const TInt KLbsDevLogMaxBufSize = 150; +_LIT(KLbsDevLogFolder, "refFiles"); +_LIT(KLbsDevLogFile,"gpsUpdates.txt"); + + +/** Static function, overwrites de log file if it already exists. +@internalTechnology +@prototype +*/ +EXPORT_C void CT_Dumper::OverWrite() + { + RFileLogger logger; + TInt err = logger.Connect(); + + if (err == KErrNone) + { + logger.CreateLog(KLbsDevLogFolder, KLbsDevLogFile, EFileLoggingModeOverwrite); + } + + logger.Close(); + } + + +/** Static function, one parameter +@param aFmt TDes string reference +@internalTechnology +@prototype +*/ +EXPORT_C void CT_Dumper::Write(TRefByValue aFmt, ...) + { + RFileLogger logger; + TInt err = logger.Connect(); + + if (err == KErrNone) + { + VA_LIST list; + VA_START(list, aFmt); + TBuf16 strList; + strList.FormatList(aFmt, list); + VA_END(list); + TBuf16 txt; + + txt.Append(strList); + + logger.CreateLog(KLbsDevLogFolder, KLbsDevLogFile, EFileLoggingModeAppend); + logger.SetDateAndTime(EFalse, EFalse); + logger.Write(txt); + } + + logger.Close(); + }