Yes, `std.format.formattedWrite` is supposed to work with a sink, but I don't think it will work at present. I believe @monarchdodra has been spending time on this problem recently.

I guess a possible work-around would be to use `sformat` with a buffer big enough for any possible value of `threadID`; that shouldn't be hard. I hear that `sformat` can still allocate heap memory even on success though, but surely it's an improvement over straight-up `format`, especially with the future in mind.