Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for log contexts, and add logging of the loading object's GUID when finding an object by GUID failed. #2368

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Menotdan
Copy link
Contributor

This PR adds support for logging contexts, which are a simple way to pass information about the caller of a function when it passes through a large call stack and when parameters would be unnecessary. This adds a lot of value to the log in several situations.

For example, if a script on a prefab is referencing an actor that is in a scene, and the developer uses the prefab in another scene, the script's reference to the actor will be broken, and a log will be shown. In the current version of the log, it will simply say what object failed to be loaded. This means you can't search for it using the content finder (Ctrl+O) because the object doesn't exist. This PR adds an extra piece of information to the log: the GUID of the script which tried to load the object, allowing you to find the script which is missing a reference much more easily.

This system can further be expanded with more context information (the name of the field that failed to load, other kinds of contexts, etc).

If this PR gets merged, I will make a PR which adds more places with log contexts and expands on the system more.

This PR also adds functionality for the GUID of a script to be searched using Ctrl+O, although currently it will just highlight the script's parent actor the same way simply searching for an actor's GUID does. This feature can also be expanded upon.

@mafiesto4 mafiesto4 added enhancement New feature or request core labels Mar 28, 2024
@mafiesto4 mafiesto4 added this to the 1.9 milestone Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants