When you talk to Studio, Studio talks back! If you talk in code, it mostly responds with messages in the Output Window. Today we are happy to present new ways for Studio to express itself with some major upgrades to the output! You can turn these on now from the Studio Beta Features menu!
Print(Tables)
Lua/Luau is all about tables - they’re everywhere! And now you can easily inspect them. With this update, using the print function on a table will print the full table contents with an expandable, explorable interface. Some important options:
By default, tables print collapsed. You can change this to print fully expanded tables if you’d like
By default, tables memory address is not displayed. You can change this to show the memory address for all tables in-line
No more being forced to write custom table unrolling functions - it just works! Print() any table! Print() every table! Just watch out for Little Bobby Tables - that guy is trouble.
Filter
Messages written to the Output Window can be classified by their type or source. Using the filter dropdowns in the top left, you can restrict the output view to only show the desired messages. Filter options include the following:
Message Type:
Output - default message type
Information - developer-facing Studio output
System - saved place, auto-saved place, etc.
Warning - you shouldn’t keep doing what you did
Error - something has gone horribly wrong
Message Context (where the message originated from - Edit/Client/Server, mostly)
Search
The Output Window can contain a lot of messages. To help find exactly the one you want, we’ve added our good friend Search! The Search window scans all messages and, importantly, respects type and context filters. Common features such as matching case, enforcing whole word match and regex (for the ambitious!) are also included.
For now, though, I’ll have to stick with custom table unwrapping. It seems like this doesn’t work with all types of tables yet, since it errors if I use certain types, like false, as a key.
This code errors:
local x = {
[false] = 3
}
print(x[false])
print(x)
… but it’s still able to print 3 fine. It works fine with the old debugger, too:
Hopefully this gets fixed soon, it’s annoying to have to remember to repr a table before I print it or to set a metatable or whatever. Is it possible to have this be a warning, rather than an error? It seems like this is a breaking change which might cause problems for testing in older games.
Edit: It seems the same holds true for tables with lots of depth or cyclic tables. A warning would probably be a better (less breaking) solution, since for those types of tables it’s not really even possible to print, unlike with a false key:
OMG, you can zoom in here too! I was just talkin’ about zooming in in the output, and it got a makeover!
All I have to say for this is:
1.
Add small arrows on the column titles to sort them accordingly. Of course, it’d be best used for the time stamp.
2.
Clicking on the drop-down arrow again should collapse the dropdown, but it re-opens it instead:
3.
It’d be so much better if we can collapse entire columns to make room for the message column (the most important one). This is so that if the output is docked with the explorer/properties window at the side, then it won’t be so squished as to make the text wrap all the way to the bottom of the window.
4.
The white border–they’re a little displeasing to look at and unnecessary. I’m used to the default low contrast feel, but having a white border in a dark background–woah man.
This is lovely! Writing a table unroller is annoying!! (Especially when a table might reference its self recursively directly or directly D:<)
Could you make the first level of a table still be the memory location of the table? I sometimes print two tables which are identical in contents, but are different tables in memory and it will help me still continue to differentiate them.
This is an amazing update, I’ve been using it since it came to beta!
I do have a few issues when using it though.
– Save our display configuration!!
the sizing and of the columns in particular, it gets to be a real pain having to readjust it every time i go in play solo or start up a new place.
– Perhaps less outlines?
Outlines make it look a bit weird, it took some getting used to (nah jk I’m still not used to it) Though if at all possible I’d love to have some these (picture below) be more visible!! I’m literally playing a “can you find it?” game every time I want to resize
This is a great update, now debugging will be easier than ever knowing that I won’t have to go through the trouble of running my tables through a special function in order to view the contents. Along with this, extra filtering and search capabilities will make our lives so much easier when looking for specific things while debugging. It’s great to see that roblox is listening to our feedback and doing what they can to make developing in studio as efficient as possible, keep these great updates coming!
This new output takes up wayy too much screen space. Do we really need to have the “context” column, when we already have the green/blue bar on the left of every message?
I’m not a fan of the pretty-printing. This makes it extremely difficult to distinguish between a pretty-printed value and the printed message.
Case: I have a testing module that returns rich results. This results table implements __tostring to spit out a large multi-line message of the entire results of the test in a human-readable format. In turn, sub-tables also implement __tostring for fine-grained inspection. This does not play well at all with the pretty-printing. Information gets repeated over and over again, with pretty-printed fields interspersed seemingly arbitrarily.
Instead, I think messages should be printed normally, as determined by tostring. If a message derives from a structural value like a table or instance, a separate column or row should be available to inspect its content, reusing the same inspection UI as the debugger. Perhaps an option to copy a pretty-printed version to the clipboard can be included (actually, that would be nice to have on the debugger as well).
I really like the QoL debugging features we’ve been getting recently, for plugins and games. The features in this update are extremely helpful - no more copy+paste of output to search for things!
Printing tables too, amazing! But I’ve noticed that if you print a table with anything else in a single print, it shows the memory address of the table.
I assume this is intentional, but just wanted to point it out.
Who else just ran HttpService:JSONEncode() on their tables to print them before this update? Because I know I certainly did. No longer do I have to script like a caveman, and for that reason I feel joy today.
Wait, hol up, printing tables? But that’s illegal.
You are telling me, I can now print the content of an entire table without converting them to JSON strings first or making a custom function for them?
That’s the stuff I need, I needed that so much, I am very happy and satisfied with this update, time to restart my studio again.
I must try out this neat feature, the refreshing output window is gonna help me so much.
Thanks so much for this.