Skip navigation

UE_LOG is easy to use! There are just a couple of tricks that you need to know.

  1. Always use the TEXT() macro
  2. When LOGGING an FSTRING, always preceed the FSTRING with *

Examples:

Plain text

UE_LOG( LogTemp, Warning, TEXT("A log message") );

Printing an FString

To print an FString into a UE_LOG() message, you have to remember to preceed the FString

UE_LOG( LogTemp, Warning, TEXT("%s"), *actor->GetName() );

To print an FString into a UE_LOG() message, you have to remember to preceed the FString

UE_LOG( LogTemp, Warning, TEXT("%s"), *FString::Printf( TEXT( "%f" ), 47.f ) );
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: