コード例 #1
0
/**
 * Creates the output file
 *
 * @return	TRUE if successful
 */
UBOOL FStatNotifyProvider_File::CreateOutputFile()
{
	const FString PathName = *(appProfilingDir() + TEXT("UE3Stats") PATH_SEPARATOR );
	GFileManager->MakeDirectory( *PathName );
	//warnf( TEXT( "ustats path: %s" ), *PathName );

	FString Filename = CreateProfileFilename( AppendedName, TRUE );
	Filename = PathName + Filename;
	//warnf( TEXT( "ustats Filename: %s" ), *Filename );


#if !CONSOLE
	FString PassedInName;
	// Check for the name passed in on the command line
	if (Parse(appCmdLine(),TEXT("STATFILE="),PassedInName))
	{
		Filename = PathName;
		Filename += PassedInName + AppendedName;
	}
#endif

	//warnf( TEXT( "ustats full: %s" ), *(Filename) );

	// Ask for a file writer
	//@todo -- joeg Create an optimized async file writer ala UC2
	File = GFileManager->CreateFileWriter( *Filename, FILEWRITE_AllowRead );
	ArchiveFilename = Filename;

	return File != NULL;
}
コード例 #2
0
ファイル: CheatManager.cpp プロジェクト: kidaa/UnrealEngineVR
void UCheatManager::LogOutBugItGoToLogFile( const FString& InScreenShotDesc, const FString& InGoString, const FString& InLocString )
{
#if ALLOW_DEBUG_FILES
	// Create folder if not already there

	const FString OutputDir = FPaths::BugItDir() + InScreenShotDesc + TEXT("/");

	IFileManager::Get().MakeDirectory( *OutputDir );
	// Create archive for log data.
	// we have to +1 on the GScreenshotBitmapIndex as it will be incremented by the bugitscreenshot which is processed next tick

	const FString DescPlusExtension = FString::Printf( TEXT("%s%i.txt"), *InScreenShotDesc, GScreenshotBitmapIndex );
	const FString TxtFileName = CreateProfileFilename( DescPlusExtension, false );

	//FString::Printf( TEXT("BugIt%s-%s%05i"), *GEngineVersion.ToString(), *InScreenShotDesc, GScreenshotBitmapIndex+1 ) + TEXT( ".txt" );
	const FString FullFileName = OutputDir + TxtFileName;

	FOutputDeviceFile OutputFile(*FullFileName);
	//FArchive* OutputFile = IFileManager::Get().CreateDebugFileWriter( *(FullFileName), FILEWRITE_Append );


	OutputFile.Logf( TEXT("Dumping BugIt data chart at %s using build %s built from changelist %i"), *FDateTime::Now().ToString(), *GEngineVersion.ToString(), GetChangeListNumberForPerfTesting() );

	const FString MapNameStr = GetWorld()->GetMapName();

	OutputFile.Logf( TEXT("MapName: %s"), *MapNameStr );

	OutputFile.Logf( TEXT("Description: %s"), *InScreenShotDesc );
	OutputFile.Logf( TEXT("%s"), *InGoString );
	OutputFile.Logf( TEXT("%s"), *InLocString );

	OutputFile.Logf( TEXT(" ---=== GameSpecificData ===--- ") );
	DoGameSpecificBugItLog(OutputFile);


	// Flush, close and delete.
	//delete OutputFile;
	OutputFile.TearDown();

	// so here we want to send this bad boy back to the PC
	SendDataToPCViaUnrealConsole( TEXT("UE_PROFILER!BUGIT:"), *(FullFileName) );
#endif // ALLOW_DEBUG_FILES
}