Stop truncating strings in Output

I occasionally need to inspect some very large string for debugging or collecting stats. Usually this string represents data from a datastore. For example, a player recently reported their data may have been corrupted, so I needed to search through a 1MB large datastore key for instances of their user-id. In the past, I’ve printed the contents of the key to the output, copied/pasted into a text editor, and Ctrl+F for their user-id to look at the relevant data. I can’t easily use that approach to help this player because the Output window truncates large strings.

I’ve debugged issues in several games by viewing large datastore keys in plaintext, so having back that ability would help me. I’m not sure if truncation was added recently, or if this is just the first time I’ve needed to inspect a string that crossed the threshold. If truncation is important, maybe it could be expanded to 4MB strings (the limit for a datastore key) or disable-able with a Studio setting.

7 Likes

I assume this is done for performance reason, print is a hilariously slow function in Studio because of the output window’s pretty print.

Of course, I do believe you should be able to turn this off if you’re trying to debug a very long JSON string.

3 Likes

Turning on Log Mode in the output should not truncate it AFAIK

3 Likes

The output is still trimmed when I enable Log Mode and run my function.

I mean, if you really want to see more of that table why not just convert it into a regular luau table and print that instead?

It would be helpful to be able to see the entire JSON string for copy and pasting reasons.
In my case, I’m trying to rewrite data on an external database.
But because of the size limitations that the post async has, I can’t send my data all at once.
In this case, I could’ve just copied the json string and put into an separate json file.
After this, I could just import it to my database (without the post async). But because of these output limitations, I can’t get the entire json data.
If you have an idea on how to solve it or an way I can make a post request append data to the database, and not just replace the existing data, it would help a lot. I’ve just got into HTTPService so I may have missed something that allowed me to do that

4 Likes