Ability to Ignore a Specific Method When Double-clicking on a Console Log

In 2022.2, you added the ability to hide methods from the console callstack.

So this code

public class TestScript : MonoBehaviour
{
    private void Start()
    {
        SomeMethodNotShownInConsole();
    }

    [HideInCallstack]
    public void SomeMethodNotShownInConsole()
    {
        Debug.Log("Hey!");
    }
}

will appear like this
8649555--1163715--upload_2022-12-9_17-25-3.png

This is really nice, but I’d like to something more. When the user double clicks on the log, I’d like Unity to ignore some methods. This would allow us to develop our own logging wrappers without breaking the UX.

For example:

public class TestScript : MonoBehaviour
{
    private void Start()
    {
        MyLogSystem.Log("Hello!");
    }
}

public static class MyLogSystem
{
    [HideInCallstack]
    public static void Log(string message)
    {
        Debug.Log(message);
    }
}

If the user double clicks on the “Hello!” log, they will be sent at line 14 inside MyLogSystem class, even if this method is hidden. I’d like to send the user to line 5 instead, at the real log instigator.

This issue severely impacts the UX of the console when working with custom logging wrappers. All the commercial Unity projects I’ve been on were using this paradigm and it was a pain to lose the double-click feature.

Should this requested “skip method on double-click” be part of the [HideInCallstack] attribute or should it be it’s own attribute? I don’t know.

8649555--1163712--upload_2022-12-9_17-24-32.png

2 Likes

In case someone stumbles on this thread when trying to find solution to this problem, I explained how I overcame it in this thread: How about getting HideInCallstack to work right?