Errors not showing script line like they used to

For the longest time, if I received a console error, it would show me the script and line (or it would show multiple so I could trace it back to the source). Now, it has different text and doesn’t show me the script name or line.

Here is a sample (Step 1 complete is the text I put in Debug.LogError, but it does it for every error I have recieved):

Step 1 finished
#0 GetStacktrace(int)
#1 DebugStringToFile(DebugStringToFileData const&)
#2 DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*)
#3 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
#4  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)

One thing to note is that I recently changed the build settings from PC to iOS. But I don’t see how that would affect this in any way.

Thanks in advance for any help you can provide,

Charlie

Well, I just figured it out. I will post the solution here for posterity.

Right click on the console tab, go to Stack Trace Logging > Error > ScriptOnly. I have included a screenshot.

Hope this helps someone!

Charlie

13 Likes

Thanks! I’ve been having this issue for a couple months (since I upgraded to Unity 2020 I think, or maybe 2019.something) and couldnt find a solution. I will add some keywords below to help fellow devs.

When I use Debug.Log now it doesnt show the stack trace, when logging error it wont show the source code line or links. Also when I double-click on the Editor Console on the Log line it wont get me to the source line in Visual Studio Code editor.

2 Likes

I have the same problem, did you find any solution yet?

I’ve found solution

I found one of SDK I’m using are setting The stackTraceType at runtime which cause the problem

I’ve forced it using:

Application.SetStackTraceLogType(LogType.Log,StackTraceLogType.ScriptOnly);

It it worked fine

When I Debug.Log, it doesn’t show the stack trace, and it doesn’t show the source code line or links when recording an error. Also, when I double-click on the Editor Console on the Log line in Visual Studio Code, it does not take me to the source line.

This may help you with intellisense and possibly other Visual Studio integration problems:

Sometimes the fix is as simple as doing Assets → Open C# Project from Unity. Other times it requires more.

Also, try update the VSCode package inside of Unity: Window → Package Manager → Search for Visual Studio Code Editor → Press the Update button

Also, this: No suggestions in Vscode

This method works for me.
Anyhow, I did not know which plugin changed this setting.