UE_LOG and format specifiers

 

  1.     UE_LOG(LogTemp, Warning, TEXT("BeginPlay() called!"));
  2.  
  3.     int myInt{ 42 };
  4.     UE_LOG(LogTemp, Warning, TEXT("int myInt: %d"), myInt);
  5.  
  6.     float myFloat{ 3.14159f };
  7.     UE_LOG(LogTemp, Warning, TEXT("float myFloat: %f"), myFloat);
  8.  
  9.     double myDouble{ 0.000756 };
  10.     UE_LOG(LogTemp, Warning, TEXT("double myDouble: %lf"), myDouble);
  11.  
  12.     char myChar{ 'J' };
  13.     UE_LOG(LogTemp, Warning, TEXT("char myChar: %c"), myChar);
  14.  
  15.     wchar_t wideChar{ L'J' };
  16.     UE_LOG(LogTemp, Warning, TEXT("wchar_t wideChar: %lc"), wideChar);
  17.  
  18.     bool myBool{ true };
  19.     UE_LOG(LogTemp, Warning, TEXT("bool myBool: %d"), myBool);
  20.  
  21.     UE_LOG(LogTemp, Warning, TEXT("int: %d, float: %f, bool: %d"), myInt, myFloat, myBool);
  22.  
  23.     // FString
  24.     FString myString{ TEXT("My String!!!") };
  25.     UE_LOG(LogTemp, Warning, TEXT("FString myString: %s"), *myString);

Comments