bbbscarter / UberLogger

Replacement logging framework for Unity, with a new editor and in-game console
MIT License
475 stars 62 forks source link

When double-clicking on a message, search for the first viewable stackframe #7

Closed Kalmalyzer closed 7 years ago

Kalmalyzer commented 7 years ago

Begin search at the top of the callstack. If the top fails to open, try the next one, etc.

This avoids the problem where you double-click on a message, the first stack frame is in glue code (like DebugHandler.Internal_Log), where source code is not available. With this in place, the default configuration of UberLogger makes double clicking on a message jump straight to the Debug.Log line which produced the message.

Kalmalyzer commented 7 years ago

I have included a second fix in this PR because it touched the same lines of code:

Do not attempt to open source if filename is null

Sometimes the stack walk will be unable to resolve an address. This results in a stackframe with FileName == null and LineNumber == 0. Do not attempt to open the source for those frames.

Kalmalyzer commented 7 years ago

Hmm, wait -- I have changed double-click behaviour for the Editor window but not for the App window. I will look into changing this for the App window as well.