In-game Debug Console [Open Source]

Hi there,

I was recently working on an open-source in-game debug console for Unity to see debug messages in game (especially useful for mobile devices). Well, I have made some real progress and wanted to share the results with you. Hope you like it :slight_smile:

Asset Store: https://assetstore.unity.com/packages/tools/gui/in-game-debug-console-68068
Also available at: GitHub - yasirkula/UnityIngameDebugConsole: A uGUI based console to see debug messages and execute commands during gameplay in Unity
Discord: yasirkula Unity Assets
GitHub Sponsors :coffee:

2680500--1249849--2.png

ABOUT

This asset helps you see debug messages (logs, warnings, errors, exceptions) runtime in a build (also assertions in editor) and execute commands using its built-in console. It also supports logging logcat messages to the console on Android platform.

User interface is created with uGUI and costs 1 SetPass call (and 6 to 10 batches). It is possible to resize or hide the console window during the game. Once the console is hidden, a small popup will take its place (which can be dragged around). Console window will reappear after clicking the popup.

2680500--1249855--3.png

Console window is optimized using a customized recycled list view that calls Instantiate function sparingly.

FAQ

  • “Receive Logcat Logs In Android” isn’t working, it says “java.lang.ClassNotFoundException: com.yasirkula.unity.DebugConsoleLogcatLogger” in Logcat

If you are sure that your plugin is up-to-date, then enable Custom Proguard File option from Player Settings and add the following line to that file: -keep class com.yasirkula.unity.* { *; }

Enjoy!

8 Likes

Package updated:

  • Performance has been improved considerably using a customized recycled list view
  • Added buttons to filter logs by their types
  • Added a popup that will take the console’s place when the console is hidden (see the main post)

And, again, it is completely free and open-source. Enjoy!

2 Likes

Update (25.08.2016):

  • Added commands: assign commands to your script functions and call them in-game using the console. Both static and instance methods are supported. Parameter types should match one of the following: int, float, bool, string, Vector2, Vector3 and/or Vector4
1 Like

That’s awesome!

Thank you :slight_smile: I’ve also submitted the package to the asset store today (free, of course). Hopefully, it will be available there, too.

2 Likes

looks great.

1 Like

The asset is updated and now supports showing native logcat entries (for Unity activity only) as well.

you were able to redirect native unity logs? How did you do it?

I execute logcat using “Process process = Runtime.getRuntime().exec( “logcat” );” on another thread in Java and pass any logs to Unity-side. Its source code is available at: https://github.com/yasirkula/UnityIngameDebugConsole/blob/master/AAR%20Source%20(Android)/LogcatLogger.java

ohh so I guess it works only on android?

Yeah, I said logcat but I forgot to mention Android :slight_smile:

Now live on Asset Store! Unity Asset Store - The Best Assets for Game Making

Can StackTrace messges also be logged on Andorid? I can’t find any option for this…

AFAIK, it is only possible if you build in Development Mode.

2 Likes

Thanks for this. Just what I needed.

Yeah I found out later that day. It does only work in Development Build…:stuck_out_tongue:

It works really fine.
Thanks also for the info “save_logs”.

I did not recognice, that i have to click on the message to get the full help info.

Thanks for you cool asset,

Alex

1 Like

Plug in is still working great! To anyone having trouble, don’t use the prefab in the prefab folder, use the prefab in the main folder. I had a problem only in build, and this allowed me to find it. Thanks a lot!

This plugin is awesome! I’ve just implemented it in an ARCore mobile app (android) using Unity version 2019.1.1f1

Could’nt get it to log Debug.LogError messages directly when running the app on an actual device, but I get the logcat messages. Therefore I added some small code to the DebugLogManager to evaluate the correct logging level and make sure each log ends up in the correct log level tab.

Thanks @yasirkula for creating this awesome tool!

1 Like

Hi @yasirkula ,

I have been working with your plugin for some time now and I encountered an issue: I create a TCP server and a TCP client and connect in asynchronous mode and then send a message from client to server and your console does not show the command Debug.Log("Received new message : " + message); but, when I run in editor, the debug.log shows.

On the client side, it stops showing logs after I call

NetworkStream stream = client.GetStream();
stream.BeginWrite(buffer, 0, buffer.Length, EndSend, data);

(the next debug.log is in the EndSend function)

On the server side, it stops showing after I call server.BeginAcceptTcpClient(OnClientConnect, new object());(the next debug.log is in the OnClientConnect function)

Would you know why the message is not showing?

Otherwise, your plugin is great and really well done so thank you for it :slight_smile:

Thank you in advance for your answer