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?
I’d also like to be able to omit the “DEBUG: SCRIPT:” at the beginning on print lines optionally.
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?
Feature request yes please.
Any updates on this? Or is it lost in space? Actually, it could be very helpful
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!
Reviving also this today
It would be great if something like this could be colored:
Some system messages have colored “labels” - this would be also great to somehow produce/access maybe:
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!