Hide UnityEngine.Debug.Log(Object) in Console

Ok I did several searches as I assume this is a very common issue, but perhaps I’m not searching correctly.
How do I hide the
‘UnityEngine.MonoBehaviour:print(Object)’
or
‘UnityEngine.Debug.Log(Object)’
lines in the Console???

1 Like

Couldn't find an answer to the same question. There's an alternative to the standard Console in the Asset Store that offers many ways to customize the output.

There are three toggles in the upper-right of the console to hide (from left to right) messages from Debug.Log, warnings, and errors. [38377-screen+shot+2015-01-07+at+12.16.45+pm.png|38377] Are those what you're looking for?

Not sure what you are asking? What Victory described or just not show Debug.Logs? like commenting them out of the code? // Debug.Log("do not print this");

I think he wants to remove the "UnityEngine.Debug.Log(Object)" line from the console but still keep the Debug.Log message output in console.

6 Answers

6

This should fix your problem :slight_smile:
67166-consolefix.png

This is definitely the best answer of all. Thanks! :)

Doesn't that also remove stack trace logs from errors? Is there a way to only remove it from debug.log ?

This has bugged me for so long.. thank you.

@KokodokoGames - Looks like as of v2017.3 you can distinguish by log level (see my answer below)

Thank you! Great answer. Nowadays, Unity offers this setting per console trace type (log, exception etc)

At the end of each debug log put

e.g.,

Debug.Log("print this ");

this will remove the “UnityEngine.Debug.Log(Object)”

in the output console.

The console gets cluttered with an extra line of text ("UnityEngine.Debug.Log(Object)") everytime you use Debug.Log. So we DO want to display the Debug.Log messages in the console, but we do NOT want the extra line that says "UnityEngine.Debug.Log(Object)". It appears NoSoul answer works by adding a \n at the end of each Debug.Log message. So now we can see the Debug.Log message but remove that extra "UnityEngine.Debug.Log(Object)". Thanks NoSoul P.S.- Would be great if there was just an option to turn this on/off so you did not have to remember to put the \n each time.

Anders_bp (below) actually shows how to change the configuration so that it is no longer required to put a "\n" at the end of all logs! :)

In Unity 2017.3.1 is number of rows for Debug.Log() defined in Log Entry. Just switch to 1 Lines and it’s done.

113619-screenshot.png

In the Console Window there are three Toggle Buttons at the top right corner.

  1. Shows ‘UnityEngine.MonoBehaviour:print(Object)’ or ‘UnityEngine.Debug.Log(Object)’ lines
  2. Shows Warning in yellow text.
  3. Shows Errors in red text.

Highlighted version of Button signifies that it will display the content. Toggling that Button to Non-Highlighted version will stop the content from being Displayed.

As you can see in the Image below. Button under “1” is non-highlighted. Which means its disabled. Hence it stops Debug messages from being displayed.
38381-ans.png

I think this does not answer the question, which is how to hide the extraneous "UnityEngine.Debug:Log(Object)" line that shows underneath each log entry in the console. Look at Anders_bp's answer, which is correct.

Just a heads-up, as of v2017.3, you can use the Console tab menu to selectively turn Stack Trace logging on/off for different log levels (regular/verbose, warning, assert, error, exception).

109158-unity-logger-update.png

I believe the “ScriptOnly” option lets you focus only on your warnings/errors, rather than anything thrown by the system at that level.

You can also change the number of lines allowed per log-entry in the “Log Entry” option.

It gets rid of the UnityEngine.Debug.Log(Object) but still adds a blank line LOL

This seems to break the ability to double click on a debug line in the console and have it show me the line of code that produced it in Rider.

@ohthepain Actually, I found out adding "\n" is really just adding a "new line" under the print output and pushing the "UnityEngine.Debug.Log(Object)" text down one line in the console. (The default console setting is to only show two lines.) Effectively, this is just hiding the "UnityEngine.Debug.Log(Object)" text from view. A clever trick but not exactly a solution to "eliminate the line from the log".

If sb. want to disable Editor.log for performance problem, just add command line as bellow( work in win10)
“H:\Program Files\Unity\Editor\Unity.exe” -logFile NUL