How to structure output for build log so it is foldable/expandable

As you can see in the screenshot above, some lines of the build log are able to be collapsed or expanded. What do I need to do to my script's output to enable this folding?
Please sign in to leave a comment.
Following off of the documentation at http://confluence.jetbrains.net/display/TCD7/Build+Script+Interaction+with+TeamCity, I found that the following worked (this is from a batch script):
Alternatively, you can do
The block method works better, in my experience, because it handles linebreaks in the output and gives a running tally of the time spent on a task.