Color codes of printed output?

I tried to use ANSI escape codes for color styling but they do not appear to work for colors printed to the Defold console. But maybe I did it wrong?

Not sure those are supported. @mats.gisselson and @Erik_Angelin?

1 Like

I’d also like to be able to omit the “DEBUG: SCRIPT:” at the beginning on print lines optionally.

1 Like

The console prints whatever is written to engine stdout/err. Some ”well known” line prefixes from the log system are recognised and highlighted. There is no support for custom highlighting or ansi codes. Feature request?

1 Like

Feature request yes please.

4 Likes

Any updates on this? Or is it lost in space? Actually, it could be very helpful :wink:

2 Likes

This.

Agree.

We have been recruiting more editor developers to be able to ship more features and fixes every release, but finding good Clojure devs with the right mindset is hard. We have signed one new developer (@vlaaad) but he hasn’t started yet and we have one more developer currently in the recruitment process. Hopefully you’ll see a lot more features shipped in Q1!

10 Likes

Reviving also this today :sweat_smile:

It would be great if something like this could be colored:
image

Some system messages have colored “labels” - this would be also great to somehow produce/access maybe:
image

Those are from the dmLog* macros (like dmLogInfo and dmLogError) that are used by the engine and native extensions. If you’re ok with using the internal version, here’s an (untested!) Lua wrapper you could put in an extension:

int Log(lua_State* L) {
    // 0 = Debug, 1 = User Debug(?), 2 = Info,
    // 3 = Warning, 4 = Error, 5 = Fatal
    int severity = luaL_checkint(L, 1);

    // The "source" of the message ("SCRIPT", "RENDER", etc.)
    const char* domain = luaL_checkstring(L, 2);

    const char* message = luaL_checkstring(L, 3);
    dmLogInternal(severity, domain, message);

   return 0;
}

It would be nice to have something like this in Defold proper!

2 Likes