stillwwater / command_terminal

Unity Command Terminal: In-Game Console
MIT License
445 stars 60 forks source link

Fix Debug.Log(); not routing through Terminal when using multi-threaded operations #21

Closed tatelax closed 4 years ago

tatelax commented 4 years ago

When calling Debug.Log or other Debug messages, the Application.logMessageReceived callback does not fire if that log message was not on the main thread.

Changing the callback to Application.logMessageReceivedThreaded means it will pick up on all log messages even if they weren't on the main thread.

I had to spend several hours today trying to figure out why my Debug Log was not firing because I was using command terminal to see the output. Once I looked in Unity I saw that some of my Debug Logs were not going through the command terminal. After further investigating I discovered it was because those Debug.Logs were not taking place on the main thread. This solved the issue.

stillwwater commented 4 years ago

Thank you!