needle-tools/needle-console

Support Logging with custom class other than "DebugEditor"

Opened this issue · 3 comments

First I want to say thank you for such an amazing console, all other assets are pretty fugly. I like the aesthetics of this one more.

https://www.reddit.com/r/Unity3D/comments/17eikh0/i_found_a_way_to_go_to_the_right_line_in_your/

Unity ignores classes that end with "Logger" and method starting with "Log" in it's console logging stack trace, allowing to double-click a line in the console and being shown the right call. I see that this philosophy is already implemented with DebugEditor.Log

I want to use a custom class (not named DebugEditor).

Maybe you could check if the class ends with Logger and the method starts with Log to match Unity's default console behavior?

image

Also, on a side note, is it normal that the name "DebugEditor" stays?
image

I would've expected the console to show 'TextureManager' for both log entries :

image

Hi, thanks, for the feedback

That's a good point - it should display TextureManager to be useful (in your screenshot you logged [TextureManager]... manually as a workaround right?)

The check for Line contains Logger would also skip e.g. MyNamespace.Logger.Anything() i believe, right? Because both Logger and .Log match. If thats the case the check would need to be a bit more exact

Would you be willing to open two PRs for these things? Happy to merge them if they work as expected :)