Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Logging with custom class other than "DebugEditor" #25

Open
AldeRoberge opened this issue Jun 17, 2024 · 3 comments
Open

Support Logging with custom class other than "DebugEditor" #25

AldeRoberge opened this issue Jun 17, 2024 · 3 comments

Comments

@AldeRoberge
Copy link
Contributor

AldeRoberge commented Jun 17, 2024

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

@AldeRoberge
Copy link
Contributor Author

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

@marwie
Copy link
Member

marwie commented Jun 17, 2024

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

@marwie
Copy link
Member

marwie commented Jun 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants