Ejemplo n.º 1
0
void CSheduleServerLog::LogList(TRefByValue<const TDesC> aFmt, VA_LIST aList)
	{
	TBuf<1024> buf;
	buf.AppendFormatList(aFmt, aList);
	WriteWithTimeStamp(buf);
	NewLine();
	}
void CMainControlEngine::WriteLog16(TRefByValue<const TDesC> aFmt, ...)
{
#ifdef __WRITE_LOG__
	//UtilityTools::WriteLogsL(_L("WriteLog16"));
	TBuf<400> tBuf;
	VA_LIST	list;
	VA_START(list,aFmt);
	tBuf.Zero();
	tBuf.AppendFormatList(aFmt,list);
	VA_END(list);

	HBufC8* buf=CnvUtfConverter::ConvertFromUnicodeToUtf8L(tBuf);
	ASSERT(buf);
	CleanupStack::PushL(buf);

	TBuf<64>	time16;
	TBuf8<64>	time8;
	TTime	tTime;
	tTime.HomeTime();
	tTime.FormatL(time16, _L("%D%M%Y%2/%3 %H:%T:%S "));
	time8.Copy(time16);

	iFile.Write(time8);
	iFile.Write(*buf);
	iFile.Write(_L8("\x0a\x0d"));
	CleanupStack::PopAndDestroy(1);
	//UtilityTools::WriteLogsL(_L("WriteLog16 End"));
#endif
}
Ejemplo n.º 3
0
void CBtraceReader::Printf(TRefByValue<const TDesC> aFmt, ...)
{
    TOverflowTruncate overflow;
    VA_LIST list;
    VA_START(list, aFmt);
    TBuf<0x100> buf;
    buf.AppendFormatList(aFmt, list, &overflow);
    iCommand.Stdout().Write(buf);
}
Ejemplo n.º 4
0
void CTestStepC32Util::Log(TRefByValue<const TDesC16> aFormat, ...)
	{
    VA_LIST vaList;
	VA_START( vaList, aFormat );

	TTruncateOverflow16 truncateOverflow;
	TBuf<512> buf;
	buf.AppendFormatList( aFormat, vaList, &truncateOverflow );
	Logger().Write(buf);
	}
Ejemplo n.º 5
0
void CSheduleServerLog::Log(TRefByValue<const TDesC> aFmt,...)
	{
	VA_LIST list;
	VA_START(list, aFmt);

	TBuf<1024> buf;
	buf.AppendFormatList(aFmt, list);
	WriteWithTimeStamp(buf);
	NewLine();
	}
Ejemplo n.º 6
0
void CHuiFxEffectParser::FailL(TInt aCode, TRefByValue<const TDesC> aFormat, ...)
    {
    TBuf<512> message;
    VA_LIST args;
    VA_START(args, aFormat);
    message.Append(_L("CHuiFxEffectParser::Fail(): "));
    message.AppendFormatList(aFormat, args);
    VA_END(args);
    __ALFFXLOGSTRING1("CHuiFxEffectParser::FailL %S", &message);
    User::InfoPrint( message );
    User::Leave(aCode);
    }
Ejemplo n.º 7
0
/**
Prints characters to the console window.

@param aFmt             The  non-modifiable descriptor containing the
                        format string. The TRefByValue class provides a
                        constructor which takes a TDesC type. 

@param ...              A variable number of arguments to be converted to text
                        as dictated by the format string. 
*/
EXPORT_C void CConsoleBase::Printf(TRefByValue<const TDesC> aFmt,...)
	{

	TestOverflowTruncate overflow;
	// coverity[var_decl]
	VA_LIST list;
	VA_START(list,aFmt);
	TBuf<0x100> aBuf;
	// coverity[uninit_use_in_call]
	TRAP_IGNORE(aBuf.AppendFormatList(aFmt,list,&overflow)); // ignore leave in TTimeOverflowLeave::Overflow()
	Write(aBuf);
	}
Ejemplo n.º 8
0
void CTestStepESockUtil::Log(TRefByValue<const TDesC16> aFormat, ...)
	{
    VA_LIST vaList;
	VA_START( vaList, aFormat );

	TTruncateOverflow16 truncateOverflow;
	TBuf<512> buf;
	buf.AppendFormatList( aFormat, vaList, &truncateOverflow );

	// write to the console
	CTestStep::Log(_L("%S"), &buf);
	}
Ejemplo n.º 9
0
EXPORT_C void CIpuTestHarness::LogIt(TRefByValue<const TDesC> aFmt, ...)
//
//	Messages to the front end emulator and to the Inu log
	{
	VA_LIST list;
	VA_START(list,aFmt);

	TBuf<KMaxFileName + 4> buf;
	buf.Append(KTestCommentPrepend);
	buf.AppendFormatList(aFmt,list);
	VA_END(list);

	WriteComment(buf);
	}
Ejemplo n.º 10
0
EXPORT_C
#if defined (_DEBUG)
void TInuLogger::LogIt(TRefByValue<const TDesC> aFmt, ...)
//
//	Messages to the front end emulator and to the log file
	{
	VA_LIST list;
	VA_START(list,aFmt);

	TBuf<KMaxFileName> buf;
	buf.Append(KTestCommentPrepend);
	buf.AppendFormatList(aFmt,list);
	VA_END(list);

	WriteComment(buf);
	}
Ejemplo n.º 11
0
void CMsvSendExe::FLog(const TDesC& aFileName, TRefByValue<const TDesC16> aFmt, ...)
	{
	VA_LIST list;
	VA_START(list, aFmt);

	TParse parse;
	parse.Set(aFileName, NULL, NULL);

	TBuf<256> buf;
	buf.Append(parse.Name());
	buf.Append(_L(": "));
	buf.AppendFormatList(aFmt, list);

	RFileLogger::Write(KSchSendLogDir, KSchSendExeLogFile, KSchSendExeLoggingMode,
				buf);
	}
Ejemplo n.º 12
0
/**
 *
 * General logging function for test steps, with severity.
 *
 * @param	"TInt aSeverity"
 *			Severity level required to log
 *
 * @param	"TRefByValue<const TDesC16> aFmt"
 *			Printf-style aFmt.
 *
 * @param	"..."
 *			Variable print parameters
 *
 * @xxxx
 *
 */
EXPORT_C void RTestStep::Log( TInt aSeverity, TRefByValue<const TDesC16> aFmt, ... )
{
	VA_LIST aList;
	VA_START(aList, aFmt);

	TIntegrationTestLog16Overflow iOverflow16;

	// decode formatted data for display on console
	TBuf<KMaxLogLineLength> lineBuf;
	lineBuf.AppendFormatList(aFmt, aList, &iOverflow16);

	// send the data to the log system via the suite
	if(LogSeverity::IsActive(aSeverity, iSuite->Severity()))
		iSuite->Log(aSeverity, _L("%S"),&lineBuf);

	VA_END(aList); 
}
Ejemplo n.º 13
0
void CTS_MultiHomingStep::StepLog(TRefByValue<const TDesC16> aText, ...)
/**
 * Logging wrapper for CEchoSocket class
 * @param aText Text for the Logging, with any other parameters
 */
	{
	VA_LIST aList;
	VA_START( aList, aText );

	// Create a formated descriptor
	TBuf <MAX_LOG_LINE_LENGTH> LineBuf;
	LineBuf.AppendFormatList( aText, aList);

	// Log to the suite's logger
	iSuite->Log( _L("%S"),&LineBuf );

	VA_END( aList ); 
	}
Ejemplo n.º 14
0
EXPORT_C void CTestUtils::Printf(TRefByValue<const TDesC> aFmt,...)
	{
	// Print to the log file.
	TTestOverflow overflow(*this);
	VA_LIST list;
	VA_START(list, aFmt);
	TBuf<0x100> aBuf;
	aBuf.AppendFormatList(aFmt, list, &overflow);

	if (iLogToConsole)
		{
		iRTest.Printf(aBuf);
		}

	if (iLogToFile)
		{
		WriteComment(aBuf);
		}
	}
Ejemplo n.º 15
0
void CPrinter::PrintL(TRefByValue<const TDesC16> aFormat, ...)
	{
	VA_LIST list;
	VA_START(list, aFormat);
		
	iBuffer.Zero();
	iBuffer.AppendFormatList(aFormat, list);
		
	iCon->Printf(iBuffer);	
	if (iLogToFile)
		{
		HBufC8* utf8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L(iBuffer);
		CleanupStack::PushL(utf8);
		User::LeaveIfError(iFile.Write(*utf8));
		CleanupStack::PopAndDestroy(utf8);
		}	
	
	VA_END(list);
	}
Ejemplo n.º 16
0
EXPORT_C void CTLogger::Log(TAny* aObject, TRefByValue<const TDesC16> aFmt, ...)
	{
	TBuf<MAX_LEN> data;

	data.AppendFormat(_L("%08x: "), aObject);

	for (TInt i = 0 ; i < Indent() ; ++i)
		{
		data.Append(KIndent);
		}

	VA_LIST args;
	VA_START(args, aFmt);
	data.AppendFormatList(aFmt, args);
	VA_END(args);

	TRAPD(err, LogL(data));
	ASSERT(err == KErrNone);
	}
Ejemplo n.º 17
0
/**
Prints a formatted string by outputting a trace packet with the Trace ID
KFormatPrintfUnicode for unicode strings and KFormatPrintf for other strings.

If the specified string is too long to fit into a single trace packet
a multipart trace is generated.

@deprecated

@param aContext 	The trace packet context. @see TTraceContext
@param aFmt 		The format string. This must not be longer than 256 characters.
@param ...			A variable number of arguments to be converted to text as dictated
					by the format string.

@return 			The trace packet was/was not output.

@See BTrace::TMultipart
*/
EXPORT_C TBool OstPrintf(const TTraceContext& aContext, TRefByValue<const TDesC16> aFmt,...)
	{
	if(IsTraceActive(aContext))
		{
		GET_PC(pc);
		TTruncateOverflow16 overflow;
		VA_LIST list;
		VA_START(list,aFmt);
		TBuf<KMaxPrintfSize> buf;
		// coverity[uninit_use_in_call : FALSE]
		buf.AppendFormatList(aFmt,list,&overflow);
		#ifndef _UNICODE
		TPtr8 p(buf.Collapse());
		return OST_SECONDARY_ANY(aContext.GroupId(), aContext.ComponentId(), aContext.HasThreadIdentification(), aContext.HasProgramCounter(), myPc, KFormatPrintf, buf.PtrZ(), p.Size());
		#else //_UNICODE
		return OST_SECONDARY_ANY(aContext.GroupId(), aContext.ComponentId(), aContext.HasThreadIdentification(), aContext.HasProgramCounter(), pc, KFormatPrintfUnicode, buf.PtrZ(), buf.Size());
		#endif //_UNICODE
		}
	return EFalse;
	};
Ejemplo n.º 18
0
void RLog::Log(TRefByValue<const TDesC> aFmt,...)
{
	// Logs in the file and calls the Printf Function from the attached  RTest object

	VA_LIST list;
	VA_START(list,aFmt);

	TBuf<0x100> aBuf;
	TBuf8 <1024> fBuf;
	aBuf.AppendFormatList(aFmt,list);
	
	if(aBuf.Mid(aBuf.Length() - 1, 1) == _L("\n")){
		aBuf.Insert(aBuf.Length() - 1, _L("\r"));
	}
	
	
	fBuf.Copy(aBuf);
	file.Write(fBuf);	
	

}
Ejemplo n.º 19
0
EXPORT_C
#if defined (_DEBUG)
/**
Function to print inputed log string on front end emulator and to write it to the log file.
@param aFmt The descriptor containing the format string. The TRefByValue class provides a constructor which takes a TDesC type.
@see TRefByValue
@see TDesC
*/
void THttpLogger::LogIt(TRefByValue<const TDesC> aFmt, ...)
//
//	Messages to the front end emulator and to the log file
	{
	VA_LIST list;
	VA_START(list,aFmt);

	TBuf<KMaxFileName> buf;
	buf.AppendFormatList(aFmt,list,this);
	VA_END(list);

	WriteComment(buf);
	}
Ejemplo n.º 20
0
void SqlPrintf(TInt /*aGroupName*/, TInt /*aTraceName*/, const char* aFormat, ...)
    {
    VA_LIST list;
    VA_START(list, aFormat);
    TBuf<128> format;
    _LIT(KTraceIdent, "SQL;");
    format.Copy(TPtrC8((const TUint8*)aFormat));
    format.Insert(0, KTraceIdent);
    format.Append(_L("\r\n"));
    _LIT(KOstI64Fmt, "%lld");
    _LIT(KDbgPrnI64Fmt, "%ld");
    ReplaceFmtSpec(format, KOstI64Fmt, KDbgPrnI64Fmt);
    _LIT(KOstDes8Fmt, "%s");
    _LIT(KDbgPrnDesFmt, "%S");
    ReplaceFmtSpec(format, KOstDes8Fmt, KDbgPrnDesFmt);
    TBuf<KSqlMaxPrnStrLen> buf;
    TSqlDes16Overflow overflowHandler;
    buf.AppendFormatList(format, list, &overflowHandler);
#ifdef _SQL_RDEBUG_PRINT    
    RDebug::RawPrint(buf);
#endif
    }
Ejemplo n.º 21
0
void CATCmdPAMDebug::Print( TRefByValue<const TDesC> aFmt,... )
    {
    TOverflowTruncate overflow;
    VA_LIST list;
    VA_START( list,aFmt );
    TBuf<256> buf;
    buf.AppendFormatList( aFmt, list, &overflow );

    // Output to IDE
    RDebug::Print( buf );

    // Output to file
    RFileLogger::WriteFormat( KDebugDir,
            KDebugFile,
            EFileLoggingModeAppend,
            buf
    );

#ifdef ATCMDPAM_DEBUG_BTTRACES
    BTLog::Print( buf );
#endif // ATCMDPAM_DEBUG_BTTRACES
    return;
    }
Ejemplo n.º 22
0
void RLog::Printf(TRefByValue<const TDesC> aFmt,...)
{
	// Logs in the file and calls the Printf Function from the attached  RTest object

	VA_LIST list;
	VA_START(list,aFmt);

	TBuf<0x100> aBuf;
	TBuf8<1024> fBuf;
	aBuf.AppendFormatList(aFmt,list);
	
	if(aBuf.Mid(aBuf.Length() - 1, 1) == _L("\n")){
		aBuf.Insert(aBuf.Length() - 1, _L("\r"));
	}
	
	

	test->Printf(aBuf);
	fBuf.Copy(aBuf);
	TInt r = file.Write(fBuf);	
	
	__ASSERT_ALWAYS(r==KErrNone,User::Panic(_L("Write-Console"),0));

}