Access Unity Log Stacktrace when highlighting a Log?

240 Views Asked by At

When I select any item from the console Log, is there any way to get access to the information is displaying? I'm interested in accessing the information as a string, is it possible?

I mean that piece of information text that appears under the console with information from the selected item. Also would be great if there was an event like ChangedSelection but I'd be fine with just the information below. enter image description here Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

The console does not have any selection event as far as i'm aware of. If you're interested in the logs however you can get all logs by using the Application.logMessageReceived event. This includes the log message and the stacktrace.

void OnEnable()
{
    Application.logMessageReceived += HandleLog;
}

void OnDisable()
{
    Application.logMessageReceived -= HandleLog;
}

void HandleLog(string logString, string stackTrace, LogType type)
{
    output = logString;
    stack = stackTrace;
}