If I overload the `toString()`, the debugger in IntelliJ will show me the `Object.toString()` result near the relevant object in the variables tab.

If `toString` is overloaded with: `return "Test1: This is toString overload";`:

[![enter image description here](https://i.stack.imgur.com/u62VX.png)](https://i.stack.imgur.com/u62VX.png)

Sometimes, what I want to see in debug isn't the same as the general `toString` overload. I know it's possible to set another expression for a specific type/class/etc, but only from the settings.

Is there a way to (globally) set an arbitrary function name that will take precedence over `toString` when such function exists?

For example:  

If `Object.toDebuggerString()` exists use it, otherwise - use `Object.toString()`.

```
class Test1 {
    @Override
    public String toString() {
        return "Test1";
    }
}

class Test2 {
    @Override
    public String toString() {
        return "Test2";
    }

    public String toDebuggerString() {
        return "Testing debugging mode";
    }
}

```