Fix newlines in language server logs when switching log types + misc (#32659)

Mistake in #31863 where the stored log entries no longer had a format
that could simply have `\n` added after each entry.

Also fixes a potential crash in the long line folding logic if unicode
was in the logs - introduced in #22996.

Also updates the log line truncation logic to never exceed the
pre-allocated capacity

Release Notes:

- N/A
babf846ef9Michael Sloan committed on 6/13/2025, 6:22:07 AM· committed by GitHubparent9a6e8a1
1 file changedLine totals unavailable