虚幻引擎:4.22
VS:2017
将自定义的Log日志,存放到项目工程或者打包程序的Saved/Logs目录下
1、创建一个C++空类,我命名为GunTestLog
2、GunTestLog.h文件
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
void UE_GUNTEST_LOG_S(FString FileName, FString Value);
static FORCEINLINE void UE_GUNTEST_LOG(FString FileName, const TCHAR* Format, ...)
{
TCHAR TempStr[1024];
va_list Ptr;
va_start(Ptr, Format);
FCString::GetVarArgs(TempStr, ARRAY_COUNT(TempStr), ARRAY_COUNT(TempStr) - 1, Format, Ptr);
va_end(Ptr);
UE_GUNTEST_LOG_S(FileName, FString(TempStr));
}
3、GunTestLog.cpp文件
// Fill out your copyright notice in the Description page of Project Settings.
#include "GunTestLog.h"
#include "Paths.h"