2
\$\begingroup\$

Unity does only display 2 lines in height for each log, at least with the default settings. I couldn't find a menu, where I could change this.

I want to display a matrix, and I need to see the log live, so it's no option for me to click on each log separately. Has unity no option to increase the height of a log line? And additionally is there no option to hide the "source" of the log like the line "UnityEngine.Debug:Log(Object)" I mean I can hide it if I click "collapse" but I don't want to collapse the entries, since it stacks the same entries which is not what I want....

enter image description here

Edit: I just saw, that there exist some plugins, which would do the job I guess. But I wonder if there is a way to solve this with the Unity console, since I don't want to pack my project full of utility stuff for developing...

\$\endgroup\$

3 Answers 3

3
\$\begingroup\$

Okay this is a simple workaround, which works but is still not the way I would like to have it. I think Unity lacks of configurability....

The trick here is, that Unity pushes everything of the log in an overflow part, so the "UnityEngine.Debug:Log(Object)" disappears, because it would be in line 3. So if you keep your log exactly two lines height, you can achieve almost a clean log.

The Code:

Debug.Log("-   -\n" +
          "|    |");
Debug.Log("|    |\n" +
          "-  -");

The Output:

enter image description here

\$\endgroup\$
3
\$\begingroup\$

In the more current versions of Unity it is now possible to change the number of lines shown for messages in the Console.

You can do so from the context menu of the Console window under the menu item "Log Entry".

enter image description here

The maximum number of lines that can be shown using this method is 10.

Also the setting applies to all message in the Console, so it unfortunately can't be used to only selectively print one supersized message amidst other more compact ones.

\$\endgroup\$
0
\$\begingroup\$

Don't think you can change that. Instead, split every matrix into multiple Debug.Log() lines, and use some sort of separator (e.g. underscores) to separate matrices legibly.

P.S. I agree, this sucks, as you should be able to use the alternating greys for separation!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ I had the log splitted, but then I had the problem that Unity writes 'UnityEngine.Debug:Log(Object)' after each log, which completely destroys your formatted logs... I guess a workaround could be to split the logs in 2 line height logs, so unity would push the unnecessary stuff into log overflow... \$\endgroup\$
    – TobiasW
    Commented Apr 7, 2016 at 12:56
  • \$\begingroup\$ @Thunder That sounds good. If you get it working, you should post the code as your answer to this question! \$\endgroup\$
    – Engineer
    Commented Apr 7, 2016 at 13:02
  • 1
    \$\begingroup\$ Yeah I did, I hope Unity will get some more configurability with the next major version. \$\endgroup\$
    – TobiasW
    Commented Apr 7, 2016 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .