Alternatives to Debug.Log

I need to have a window that would constantly log the game status (it helps me debug the game).
Debug.Log is great for this but if I use it in few Update() loops the game becomes unplayable from all the lag which Debug.Log creates.

What are some more practical ways of doing this that you know of?
Using a file for logging wouldn’t show results in real time and using a Text object would block game view.
Maybe there is a more efficient asset that can replace Debug.Log window?

You could create an editor window, and add text to it or have it pull the text from the game. Whenever you need the information, just open the window and dock it somewhere.

We do that for our audio system - there’s an audio overview window that every audio source reports to when they get created/destroyed. The window shows what each audio source is currently playing.

It’s a lot faster than the Debug.Log’s, and a lot easier to look through. You could try to do something like that. Read up on creating custom windows here.

2 Likes

There is a link in my signature for a tool for trending floats. May or may not be useful to you.

The key reason debug.log statements are so slow is they do a full stack trace each time. If you are just outputting some text to the screen it doesn’t need to be particularly expensive. @Baste 's suggestion for an editor window is a good one. If you need something in game you could adapt this tutorial on a chat box.