Additional console print options besides print() and warn()

As a Roblox developer, it is currently impossible to print to the console with a color that indicates status/severity other than the yellow/orange from warn(), and even with that…

As a Roblox developer, it is currently impossible to print console warnings that distinguish developer-code warnings and errors from Roblox code warnings (like the infinite yield warnings). I often care about only one or the other when debugging a specific feature.

I like the Error / Warn / Info filtering in the console, but while developing I’ve often found myself wanting to be able to output things in additional colors, most especially:

  • Bright green output messages for “everything’s fine”, aka OK status messages for at-a-glance evaluation of things like server startup conditions.
  • Ability to use Red or another bold color to indicate a serious warning without having to throw via error()

In the most general form, this could be a new variant of print() that has a Color3 parameter. A more sophisticated version might let the developer supply not only a color, but a string key for the message type/severity which could be registered with corescripts and added to the list of filtering checkboxes under Client and Server logs.

Thoughts?

59 Likes

Being able to color-code print messages would be pretty helpful.

To get around it myself, I just made a custom function that formats it differently and hides certain debug messages if the debugging level isn’t set high enough to display them. ( Something like a function starting won’t show unless I set it to show all debug messages. )
Formats like
[ system name ] [ debug severity ] [ script name ] (message here)
Alternates between warn()/print() depending on how high the severity is.

That’s of course the longer way to go around it, though.

4 Likes

This is something that’s been on my mind for a while. I sometimes like to get spammy with prints and warnings just so I can find my answers faster. It would be pretty nice to color-code that one cframe variable that gets printed on Heartbeat and color code it based on its correctness.

This is what I currently do too, bracketed tags just like this so I can use the console text filtering.

3 Likes

I support. Maybe have tags so you can categorise them to make it easier to search and manage.

(Also why is a Roblox staff member sending a request here, isn’t there something internal for that?)

3 Likes

yes please

1 Like

We have internal feature requests too, but this particular feature would be primarily for developers, not so much for Roblox engineers apart from those of us who work on CoreScripts and PlayerScripts, and we’re outnumbered by devs by a few orders of magnitude. So, it’s most useful to know if (and how) the development community would use this, and what others’ needs are in this area. Think of this as more of an RFC (request for comment) than a request being made to Roblox.

5 Likes

I too would like to print in red for error information without having the script actually stop.

Most of the time I have been using warn for errors but having it say [Error]: to make it clear thats its not a usual warning.

Also having a way to use green for things like saying everything is good, would also help. so it doesn’t get lost in the white messages that usually gets printed for informational stuff.

Specifying keys instead of colors is more useful. I’d like to be able to do something like:

log("Debug", "The script has started running")

and then disable debug output for finished scripts, but retain it for in-progress code. No more:

local DEBUG_ENABLED = false

local oldPrint = print
function print(...)
    if not DEBUG_ENABLED then return end

    oldPrint(...)
end


print("The script has started running")
9 Likes

I typically print a lot of information under normal conditions, so when something different or urgent is printed, it’s extremely difficult for me to pick it out of the output ocean unless I use warn(), which can also quickly become over-saturated. I would love to be able to categorize my messages in a more granular way.

Additional colors in the output log would be extremely useful for quickly identifying patterns or spotting certain messages, and being able to filter messages by programmer-defined keys would also be very powerful (you wouldn’t need to rely on message color to find messages of a certain type). However, since the context of a message may be important (an important message may be surrounded by relevant information messages), both of these features would be fantastic to have.

1 Like

Oh right, that makes sense then.

The way I inherently see the platform feedback section (excluding engineering feedback) is that it’s Roblox developers giving features to Roblox engineers. I don’t see why you can’t do that, I just find that it’s an odd thing but I do welcome if more try. Just something odd to me.

1 Like

Ah, some of us are both though :grin: [insert multiple-inheritance joke here] I was at home on a holiday, making a Roblox game with my daughter when I had this idea, and I would not be the engineer to implement this feature, so your criterion is met!

3 Likes

Yeah I like keys! That way you can filter out exactly what you want to see too. And then perhaps you could assign a color per key?

3 Likes

Yeah, logging support over just colors would definitely be preferable. Running into issues right now with current tooling :(

2 Likes