Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added colors for Debug.log - #4179

#4179
Open
CodeForBeauty wants to merge 2 commits into
FlaxEngine:masterFlaxEngine/FlaxEngine:masterfrom
CodeForBeauty:log-colorCodeForBeauty/FlaxEngine:log-colorCopy head branch name to clipboard
Open

Added colors for Debug.log#4179
CodeForBeauty wants to merge 2 commits into
FlaxEngine:masterFlaxEngine/FlaxEngine:masterfrom
CodeForBeauty:log-colorCodeForBeauty/FlaxEngine:log-colorCopy head branch name to clipboard

Conversation

@CodeForBeauty

Copy link
Copy Markdown
Contributor

Added color formatting in Debug.Log, as requested in #294

The implementation is based on RichTextBox. And has the same syntax.
Formatting is only added on the LogEntry and is not applied to the expanded log info on the bottom of the window when log is selected. Let me know if it is needed there.

Some maybe important quirks:

  • The formatting is implemented directly inside the LogEntry. There is no ability to disable it. I don't think anyone will need to have text: in their logs. But if that's a concern let me know.
  • Any other tags beside color are left in.
  • The implementation ended up being a simpler version of the RichTextBox. So there is some duplicate code. If this is an issue, let me know how it should be resolved.
  • Performance is worse. I'm not sure by how much. On my Windows machine I didn't feel any difference.

Tested on Windows11 machine.

@CodeForBeauty

Copy link
Copy Markdown
Contributor Author

Here's the script I've used for testing:

using FlaxEngine;

namespace TestProj;

public class TestLog : Script
{
    public override void OnStart()
    {
        Debug.Log("Normal text, <color=red>red text</color>, <color=blue>blue text</color>");
        Debug.Log("Normal text, red text, blue text");
        Debug.Log("Test \ntext, <color=yellow>yellow</color>");
        Debug.Log("Test \ntext \ntext \ntext \ntext");
        Debug.Log("Really, really, really, really, really, really, really, really, really, really, really, really, really, really, really long log" +
            "Really, really, really, really, really, really, really, really, really, really, really, really, really, really, really long log" +
            "Really, really, really, really, really, really, really, really, really, really, really, really, really, really, really long log" +
            "Really, really, really, really, really, really, really, really, really, really, really, really, really, really, really long log");
        Debug.Log("<Color=pink>pink</color>, <b>otherTag</b>");
        Debug.Log("<color>empty</color><color=orange>orange</color>normal");
        Debug.LogWarning("<color=red>red</color>testing");
        Debug.Log("<color=red>red <color=yellow>yellow nested</color>");
    }
    
    public override void OnUpdate()
    {
        Debug.Log("Multiple log collapse test");
    }
}

@mafiesto4 mafiesto4 added enhancement New feature or request editor labels Jul 12, 2026
@mafiesto4 mafiesto4 added this to the 1.13 milestone Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.