Buffered Output

Windows can't handle multiple console calls and ignores after the first.

Reimplementing an earlier workaround submitted by @tomgasson to buffer all the logging lines into a single string to output only once at the end.