UE_LOG not accepting fstring as a parameter?

For some reason after I added UE_LOG I received a compiler error. It ran fine before I added the third line.
Here is the code:

    const FString ReceivedUE4String = BinaryConversion(ReceivedData);

     data = stringData(ReceivedUE4String);

     UE_LOG(LogTemp, Warning, TEXT("This is the data: %s"), ReceivedData);

I’ve added the output log as well:

Hello, aegle

I am sorry to hear about your problem.
Please, however, note, that %s strings are wanted as TCHAR* by Log, so you should use *FString().

Hope this helped!

Have a great day!

4 Likes

You may want to look at this.

Here is an example code of how to fix it:

 UE_LOG(LogTemp, Warning, TEXT("This is the data: %s"), *FString(ReceivedData));
7 Likes