question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clicking on a log doesn't jump to the code line but to ForwardToUnity() - Unity 2019.2.1

See original GitHub issue

We recently upgraded from Unity 2018 to 2019.2.1. Before, when I clicked on a log, it used to go to the line in the code. Now it goes to else if(severity==LogSeverity.Error) UnityEngine.Debug.LogError(showObject); instead

`[LogUnityOnly()] static void ForwardToUnity(UnityEngine.Object source, LogSeverity severity, object message, params object[] par) { object showObject = null; if(message!=null) { var messageAsString = message as string; if(messageAsString!=null) { if(par.Length>0) { showObject = String.Format(messageAsString, par); } else { showObject = message; } } else { showObject = message; } }

        if(source==null)
        {
			if(severity==LogSeverity.Message) UnityEngine.Debug.Log(showObject);
            else if(severity==LogSeverity.Warning) UnityEngine.Debug.LogWarning(showObject);
            else if(severity==LogSeverity.Error) UnityEngine.Debug.LogError(showObject);
        }
        else
        {
            if(severity==LogSeverity.Message) UnityEngine.Debug.Log(showObject, source);
            else if(severity==LogSeverity.Warning) UnityEngine.Debug.LogWarning(showObject, source);
            else if(severity==LogSeverity.Error) UnityEngine.Debug.LogError(showObject, source);
        }
    }`

We are using a simple “middleman” class called CustomDebug:

`public static class CustomDebug {

private const bool USE_UBER_LOGGER = true;

[UberLogger.StackTraceIgnore]
public static void LogWarning(string message, DebugType debugType = DebugType.Temp, UnityEngine.Object obj = null)
{
    string log = "";

    if (Application.isEditor)
        log = $"{message} [{obj?.name}] [{debugType}]";
    else
        log = $"{message} [{obj?.name}] [{debugType}] [{UnityEngine.SceneManagement.SceneManager.GetActiveScene().path}] [Frame {UnityEngine.Time.frameCount}] [{System.DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")}]";

    if (USE_UBER_LOGGER)
        UberDebug.LogWarningChannel(obj, debugType.ToString(), log);
    else
        Debug.LogWarning(log, obj);

}

}`

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Rademanccommented, Apr 16, 2020

Replace line 751 in UbberLoggerWindow.cs with this : if (UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(filename, frame.LineNumber, 0 ))

0reactions
jalakocommented, Apr 16, 2020

Replace line 751 in UbberLoggerWindow.cs with this : if (UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(filename, frame.LineNumber, 0 ))

I can confirm that this fix is working for me on Unity 2019.2.6f1 on Windows 10. The file you mean though is “UberLoggerEditorWindow.cs”

Read more comments on GitHub >

github_iconTop Results From Across the Web

My jump script wont work.
This script is supposed to tell unity that when I "Jump" (press space) It makes me jump but when I go in play...
Read more >
Unity Jumping code for player not working
cs, but when I run it and try to click it, it wont make my player jump. I thought the problem was the...
Read more >
Scripting API: Transform.forward
Returns a normalized vector representing the blue axis of the transform in world space. The example below shows how to manipulate a GameObject's...
Read more >
Better Jumping in Unity With Four Lines of Code - YouTube
Eliminate the low-gravity feeling of a physics based jump with four lines of code. Actually, just two lines. The other two give you...
Read more >
Unity C# - Making Your Character Jump (Beginner ... - YouTube
This is a VERY beginner-friendly guide made just for the type of person who knows absolutely nothing about coding or working with Unity....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found