Is there any way to link to an object in assert or log text?

Is there a way to create some sort of direct link to an object/actor when creating asserts or log messages?

For (a bad) example, let’s say we have a large number of actors placed in the level. All of these actors need to be at least 1 meter away from each other. There’s some validation code running that detects if any of these actors is too close and it pops an assert. Manually searching through the level for the problem actors would a huge pain. Printing the names of the actors would help, but since duplicate names are allowed, that isn’t always helpful.

Is there some way to generate a unique link to the objects in question? Preferably something clickable in some way that would center the camera on the actor?

hi,
how about that ?

the camera




just a scroll box

the scroll box entries


this is the test actor call … the delay is to ensure the camera has setup the widget



hope this helps you :slight_smile:

cheers :vulcan_salute:

Thanks for the reply. I think you might have misunderstood me, though. What I’m looking for is something that would be done outside of the game when an assert is hit (e.g. checkf/ensureMsgf in code or any of the Assert nodes in blueprint) such that the message output would have useful information in linking to the offending object(s).

More specifically, this link would be inside of the assert popup or within the log. This is especially critical for issues that are caught by QA or automation so this can be logged and checked out by a dev later.

hi,
oh sorry, was late yesterday… i will look into that :slight_smile:

cheers :vulcan_salute:

take a look at IMessageToken in Engine\Source\Runtime\Core\Public\Logging\TokenizedMessage.h
and FUObjectToken for hyperlink to actors

I tried this out and it didn’t print a hyperlink, just the object name. Here is the code I used (this pointer is an actor). Is this right?

TSharedRef<FTokenizedMessage> Message = FTokenizedMessage::Create(EMessageSeverity::Error)->AddToken(FUObjectToken::Create(this));
FMessageLog("Test").AddMessage(Message);

Sorry I misled you by suggesting FUObjectToken for actors
The reason I ended up here in the first place is because it was my first time needing to do that kind of stuff
You actually want to use FActorToken with actors
FActorToken::Create(GetPathName(), GetActorGuid(), TextForTheLink)
A factory from an AActor* would be nice in this case…

Roughly the same thing here. Without entering anything for the text param, it’s just printing a path which is based on PIE and so is not useful. It’s even worse with the text param as it just prints that text.

Am I looking in the wrong place or something? I’m just using the Output Log in the editor.