Add a project setting to enable stdout flushing in release builds

This can be used in server builds for journalctl compatibility.
This commit is contained in:
Hugo Locurcio 2020-12-15 14:40:09 +01:00
parent 6ccc6b6e28
commit 341b9cf15a
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
3 changed files with 24 additions and 9 deletions

View file

@ -1121,6 +1121,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
#endif
// Only flush stdout in debug builds by default, as spamming `print()` will
// decrease performance if this is enabled.
GLOBAL_DEF("application/run/flush_stdout_on_print", false);
GLOBAL_DEF("application/run/flush_stdout_on_print.debug", true);
GLOBAL_DEF("logging/file_logging/enable_file_logging", false);
// Only file logging by default on desktop platforms as logs can't be
// accessed easily on mobile/Web platforms (if at all).