Should fix #33195 (still testing, trying to reproduce locally, draft until then)
Logging to file is unbuffered (src), but is not blocked by flushing. Generally, that seems desireable, but it can be problematic for tests.
#33195 observes intermittent failure of the TestLogFromLocation()
function (see comment for more details), where we write and read to/from file in quick succession.
This PR introduces a Logger::FlushDebugFile()
method, and uses it in the test-only ReadDebugLogLines()
function. As such, this PR should not change any non-test behaviour or performance.