Skip to main content

Logging

Format

Format SpecifierType
%cCharacter
%dSigned integer
%eor %E Scientific notation of floats
%fFloat values
%gor %G Similar as %e or %E
%hiSigned integer (short)
%huUnsigned Integer (short)
%iUnsigned integer
%lor %ld or %li Long
%lfDouble
%LfLong double
%luUnsigned int or unsigned long
%lli or %lldLong long
%lluUnsigned long long
%oOctal representation
%pPointer
%sString
%uUnsigned int
%x or %XHexadecimal representation
%nPrints nothing
%%Prints % character

Examples

int intValue = 3;
float floatValue = 3.14;
double doubleValue = 3.14159265359;
UE_LOG(LogTemp, Display, TEXT("SomeFormat %s"), *GetName());
UE_LOG(LogTemp, Warning, TEXT("SomeFormat %d %20.1f %f"), intValue, floatValue, doubleValue);
UE_LOG(LogTemp, Warning, TEXT("SomeFormat %f %-20.1f %lf"), intValue, floatValue, doubleValue);

Blueprint

PrintString, PrintText

InString, PrintToScreen, PrintToLog, TextColor, Duration, Key

Example

Key is if you want to override an existing value. For example: if you were printing a status like FPS or ping, you likely don't care about past versions, so only ever show the most current one.

OtherThing