Debug.log()
FormattingIf you’ve ever found yourself squinting at Unity's console as hundreds of messages scroll by, trying to catch the needle in the haystack, I have good news. You can use Rich Text markup in Debug.log()
strings to make things easier to spot at a glance.
Surround text in html style <b></b>
tags to make it bold, or <color=#00ff00ff></color>
to make it coloured.
The colour value can be defined either as a named colour from a built in list, or an RGBA hex code.
Debug.Log("<b>Bold text</b>");
Debug.Log("<color=lime>Coloured text!</color>");
Debug.Log("<color=#ff00ffff><b>Bold and Coloured text!</b></color>");
Tip: If, like me, you want to display success and failure messages you may find the red
and green
named colours hard to read. Try orange
and lime
instead :)
Happy coding!