CheckVA Error when printing FVector to log

I have an FVector result and am trying to log it with:

UE_LOG(LogTemp, Warning, TEXT("Result is %s"), result.ToString());

I’m a bit surprised this isn’t working, as it seems to be what is in the wiki.
Having worked around this error by printing with floats for entirely too long, would someone kindly explain why this line results in the following error?

Severity Code Description Project File Line Suppression State
Error C2665 ‘CheckVA’: none of the 11 overloads could convert all the argument types Slingshot c:\program files (x86)\epic games\4.10\engine\source\runtime\core\public\Misc\OutputDevice.h 377

Hi,

You cannot pass FStrings through a variadic function in C++. You should convert it to a TCHAR pointer instead by using the * operator on the result of your ToString() call, like this:

UE_LOG(LogTemp, Warning, TEXT("Result is %s"), *result.ToString());

Steve

of course! not sure what ue4 c++ magic i expected to take care of that for me. thank you!

Omg, finally I can print a simple vector in the game engine. UE should have simpler versions of log printing. There is such a thing as UX for programming, and time spent typing code.

Well, thanks for this. But its nice if we can get a more advanced UE_LOG as a tool for development.