Which method to use?

Looking through the doc I found a few ways to accomplish to log the location of the actor, I tried 2 options which seemed the best,easiest via the LOG macro and they work.

My code:
//logger macro test
FString ObjectName = GetOwner()->GetName();
FString ObjectPos = GetOwner()->GetActorLocation().ToString();
FString Tests = GetOwner()->GetTransform().GetLocation().ToString();
UE_LOG(LogTemp, Warning, TEXT(“Position report for %s . It’s location is at %s and tests %s”), *ObjectName, *ObjectPos, *Tests);

LOG output:
LogTemp: Warning: Position report for SM_Chair_2 . It’s location is at X=50.000 Y=-160.000 Z=20.000 and tests X=50.000 Y=-160.000 Z=20.000
LogTemp: Warning: Position report for SM_Rock_2 . It’s location is at X=20.000 Y=270.000 Z=20.000 and tests X=20.000 Y=270.000 Z=20.000

As you see both work and give the same output.
How do I chose which method to use as I assume in larger/complicated projects it makes a difference regarding used resources or compile times.

Privacy & Terms