Closed
Description
Since the "logs unified format" (#5700) restructuring of the server example some time ago, only one of the code-paths in the server_log()
function calls fflush
after emitting stdout output. Only the code-path that generates text log-style uses fflush
, while the JSON formatting does not.
This causes a problem on some platforms (Windows for me) when hosting server as a child process. Log output never reaches the stdio consuming host. Also, using fflush
tends to solve a race between stderr and stdout output on some platforms.