Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Errors not showing script line like they used to

Discussion in 'Editor & General Support' started by cstobler, Nov 4, 2020.

  1. cstobler

    cstobler

    Joined:
    Apr 25, 2019
    Posts:
    20
    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):

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

    cstobler

    Joined:
    Apr 25, 2019
    Posts:
    20
    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
     

    Attached Files:

  3. pertz

    pertz

    Joined:
    Jan 8, 2015
    Posts:
    106
    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.
     
    MrOaT and OmarVector like this.
  4. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    117
    I have the same problem, did you find any solution yet?
     
  5. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    117
    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
     
  6. StevenTillson02

    StevenTillson02

    Joined:
    Jun 30, 2021
    Posts:
    11
    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.
     
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    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.

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

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

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
  8. yuhuilalala

    yuhuilalala

    Joined:
    Nov 8, 2014
    Posts:
    7
    This method works for me.
    Anyhow, I did not know which plugin changed this setting.