%s Attempting to fire."), *GetNameSafe(this

https://wiki.unrealengine.com/Logs,_Printing_Messages_To_Yourself_During_Runtime

MyClass.CPP

//...
void UMyClass::FireWeapon()
{
 UE_LOG(LogMyGameSomeSystem, Verbose, TEXT("UMyClass %s entering FireWeapon()"), *GetNameSafe(this));
 //Logic
 UE_LOG(LogMyGameSomeSystem, Verbose, TEXT("UMyClass %s Attempting to fire."), *GetNameSafe(this));
 if (CheckSomething())
 {
  UE_LOG(LogMyGameSomeSystem, Log, TEXT("UMyClass %s is firing their weapon with charge of %f"), *GetNameSafe(this), GetCharge());
  //Firing logic
 }
 else
 {
  UE_LOG(LogMyGameSomeSystem, Error, TEXT("UMyClass %s CheckSomething() returned false during FireWeapon(), this is bad!"), *GetNameSafe(this));
  //Fail with grace
 }
 //More code!
 UE_LOG(LogMyGameSomeSystem, Verbose, TEXT("UMyClass %s leaving FireWeapon()"), *GetNameSafe(this));
}
 
void UMyClass::Tick(float DeltaTime)
{
 UE_LOG(LogMyGameSomeSystem, VeryVerbose, TEXT("UMyClass %s's charge is %f"), *GetNameSafe(this), GetCharge());
 if (something)
 {
  UE_LOG(LogMyGameSomeSystem, VeryVerbose, TEXT("Idk"));
 }
 if (somethingelse)
 {
  UE_LOG(LogMyGameSomeSystem, VeryVerbose, TEXT("Stuff"));
 }
}
//...

댓글

이 블로그의 인기 게시물

About AActor!!! "UObject" has no member "BeginPlay"

UNREAL Android build information

Shader informations nice blog ~ ~