%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")); } } //...
댓글
댓글 쓰기