Logger: Cache 'flush_stdout_on_print' to improve performance, and works before ProjectSettings starts.

ProjectSetting: Now 'application/run/flush_stdout_on_print' requires a restart of the Editor to take effect
This commit is contained in:
Mateo Kuruk Miccino
2021-02-28 19:26:14 -03:00
parent 165d77a496
commit 89283b7b53
4 changed files with 18 additions and 4 deletions

View File

@ -41,6 +41,8 @@ class Logger {
protected:
bool should_log(bool p_err);
static bool _flush_stdout_on_print;
public:
enum ErrorType {
ERR_ERROR,
@ -49,6 +51,8 @@ public:
ERR_SHADER
};
static void set_flush_stdout_on_print(bool value);
virtual void logv(const char *p_format, va_list p_list, bool p_err) _PRINTF_FORMAT_ATTRIBUTE_2_0 = 0;
virtual void log_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type = ERR_ERROR);