Comments (9)
Thanks -- I got a repro of it just now. It is a Windows specific problem, having to do with forward vs backward slashes.
This opens correctly in my editor of choice:
- frame {UberLogger.LogStackFrame} UberLogger.LogStackFrame
DeclaringType "PendingUnitAbility" System.String
FileName "C:\\Plastic\\FreedomPrototype\\Assets\\Scripts\\PendingUnitAbility.cs" System.String
FormattedMethodName "PendingUnitAbility.Execute(System.Action completionCallback) (at Assets\\Scripts\\PendingUnitAbility.cs:86)" System.String
LineNumber 86 System.Int32
MethodName "Execute" System.String
ParameterSig "System.Action completionCallback" System.String
This opens in the wrong editor:
- frame {UberLogger.LogStackFrame} UberLogger.LogStackFrame
DeclaringType "FireAgainstUnitVisualTrigger+<AimThenFire>c__Iterator0" System.String
FileName "Assets/Scripts/Abilities/VisualTriggers/FireAgainstUnitVisualTrigger.cs" System.String
FormattedMethodName "FireAgainstUnitVisualTrigger+<AimThenFire>c__Iterator0.MoveNext () (at Assets/Scripts/Abilities/VisualTriggers/FireAgainstUnitVisualTrigger.cs:41)" System.String
LineNumber 41 System.Int32
MethodName "MoveNext " System.String
ParameterSig null System.String
Your screenshot is also one with forward slashes. When I look around at callstacks in my application it seems that paths come in three forms with the current UberLogger stacktrace code:
C:\buildslave\unity\...
- Unity's internal callstacks. We do not have source so these are not openable.Assets\blah\...
- Code from my projectAssets/blah/...
- Code from my project
The third form does not open correctly.
There are several things we could do to sort this out:
- Ensure that paths are always presented with backslashes on Windows. Before doing that, I wonder why there is a mix of forward- and backward-slashes though. Does that have to do with there being two methods for retrieving callstacks? Is this perhaps Unity 4.x legacy? Is it a good idea to have both?
- Follow up on #2 and change the open-file call method to something else. Changing that has a downside in that paths outside of Assets/ will not open correctly. I'm not sure when those would appear... perhaps when using pre-built binaries / when splitting a Unity project over multiple build steps, if that is at all possible?
from uberlogger.
This might be related to #2 . With the current implementation, I notice that some paths open in MonoDevelop while other paths open in Visual Studio.
from uberlogger.
@michidk can you repro this? I know it sometimes happens but cannot repro it myself now. If you can, would you also be able to breakpoint on the line where UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal is called, and tell us what arguments are being passed to that function?
from uberlogger.
So this happens on both machines where i tested... Both of them running Unity 5.5 and having Sublime Text installed.
I noticed that Sublime Text only opens when Visual Studio is open. If Visual Studio is not running, a doubleclick always opens VS on the correct line.
Sadly after I added a Debug.Log line to print out the parameters of OpenFileAtLineExternal
, it worked again.
from uberlogger.
Yeah, using debug.log for capturing results is "dangerous" whenever we deal with a tool that is intended to hook console logging; that is why I suggest putting a breakpoint on the line and inspecting variables in scope instead (and copy/pasting the exact results to this ticket so we have something more meaty to go on).
It should be possible to do it like this:
- dev normally
- once you notice that a file opened in the wrong editor, place a breakpoint, attach to Unity, and attempt again to open the same exact file
- inspect method arguments
from uberlogger.
Didn't know you can debug editor stuff. Awesome!
from uberlogger.
@bbbscarter What's the reason for having two different methods for retrieving callstacks? Is this to do with 4.x + 5.x compatibility? Do you know of specific situations where one method works better than the other?
from uberlogger.
One of them is for intercepting callstacks that come directly from Unity (e.g. Debug.Logxxx), the other is for intercepting callstacks from UberLogger itself (e.g. UberDebug.Logxxx). The former is slow and tries to fill in bits of missing info by parsing the already-stringified callstacks; the latter is fast and robust.
(Assuming those are the two paths you mean).
from uberlogger.
Hmm. It appears that the homemade stack-walk is being used for Debug.Logxxx calls as well. It is only if that walk totally fails that UberLogger falls back on parsing the Unity-provided multi-line string.
Unity does not show paths to internal code (i.e. C:\buildslave\Unity\...
) and if there are multiple of these in the callstack it will collapse them (so I think you just see the "entry point").
Anyway, to the matter at hand; I think the right thing to do is to change folder separators in any paths to Assets\blah\...
format on Windows before calling UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal
.
from uberlogger.
Related Issues (20)
- Keyboard navigation in message & callstack views in the Editor window
- Copy messages and stacktrace into clipboard HOT 1
- Message element height is controlled by largest message HOT 6
- Multi-line messages make last entry on screen not display properly HOT 2
- Multi-column layout for messages in message pane HOT 2
- UberDebug.Log() uses Warning severity instead of Message HOT 2
- Uber Console doesnt show compiler errors HOT 5
- "Register" info message from UberLogger HOT 4
- Own namespace for UberLogger HOT 1
- TypeLoadException HOT 2
- didn't work in untiiy 5.6.1f 64bit. HOT 1
- UberLogger does not show full callstack for unhandled exceptions HOT 1
- Logging 'badge' increases line width, creating a horizontal scroll bar
- Unity 2017.x remote-machine streamed logs display poorly in UberLogger
- In-game window does not work properly when there are too many filters
- Editor Console Window works poorly with many filters
- Editor Console window has poor performance with 1000+ lines in window HOT 1
- Clicking on a log doesn't jump to the code line but to ForwardToUnity() - Unity 2019.2.1 HOT 7
- Hangs on long log lines.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uberlogger.