Hey guys, so I defined a custom macro to log out of a tutorial somewhere on YouTube
#define __FUNCTION__String FString(__FUNCTION__)
#define __LINE__String FString(__LINE__)
/** Helper to log with class name, function identifier, and line number included */
#define DH_LOG(CategoryName, Verbosity, Format, ...) UE_LOG(CategoryName, Verbosity, TEXT("%s [%s]: %s"), *__FUNCTION__String, *__LINE__String, *FString(Format), __VA_ARGS__)
However, when using the VA_ARGS parameter to enter in an FString with TEXT("%s")
DH_LOG(LogOnlineGame, Display, TEXT("Starting session %s on client"), *DHPlayerState->SessionName.ToString());
Compiler outputs this error:
1>D:\Library Storage\Unreal Projects\DistantHome\Source\DistantHome\Private\Player\DHPlayerController.cpp(193): error C2440: '<function-style-cast>' : cannot convert from 'int' to 'FString'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
So how do I resolve this?
Here’s the full UBT log, just in case: Log - Pastebin.com