Output windows clears when stopping play solo with scripts executing past deadline

If I am printing lots of text to the output (e.g. on heartbeat every frame) while game:BindToClose() is yielding past the deadline, the output will be cleared immediately afterwards, regardless of whether “clearing output on start” is enabled in settings or not.

Reproduction code:

game:BindToClose(function()
   while task.wait() do end
end)
game:GetService("RunService").Heartbeat:Connect(function()
   print("Text")
end)

Video:
(Skip to the end since it’s mostly just waiting)

Thank you for the report, we’ll take a look.

Did you notice if this is happening for a certain amount of lines? Studio Output has a 5000 line limit by default:

That looks to be related. If you count up all the printed messages in the video you can see that they sum to exactly 5000 (3193 + 6 + 1801). So maybe it’s not a bug after all - though it is very unintuitive.

Yes, that makes sense, and what has happened here was that your logs got collapsed due to the duplicate lines, plus the ones that were over the max limit were removed from the top of the buffer.

You can still expand the lines that were collapsed.

By the way, I wouldn’t recommend logging on every heartbeat as it really makes the overall performance worse, instead I usually add conditions to the logging or use conditional logpoints.