mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Ability to print and log script backtraces
Co-authored-by: Mikael Hermansson <mikael@hermansson.io>
This commit is contained in:
parent
f704113abe
commit
d1dcb40d56
32 changed files with 813 additions and 95 deletions
|
|
@ -84,13 +84,13 @@ String OS::get_identifier() const {
|
|||
return get_name().to_lower();
|
||||
}
|
||||
|
||||
void OS::print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify, Logger::ErrorType p_type) {
|
||||
void OS::print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify, Logger::ErrorType p_type, const Vector<Ref<ScriptBacktrace>> &p_script_backtraces) {
|
||||
if (!_stderr_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_logger) {
|
||||
_logger->log_error(p_function, p_file, p_line, p_code, p_rationale, p_editor_notify, p_type);
|
||||
_logger->log_error(p_function, p_file, p_line, p_code, p_rationale, p_editor_notify, p_type, p_script_backtraces);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ protected:
|
|||
bool _silent_crash_handler = false;
|
||||
|
||||
// Functions used by Main to initialize/deinitialize the OS.
|
||||
void add_logger(Logger *p_logger);
|
||||
|
||||
virtual void initialize() = 0;
|
||||
virtual void initialize_joypads() = 0;
|
||||
|
|
@ -142,7 +141,7 @@ public:
|
|||
virtual Vector<String> get_video_adapter_driver_info() const = 0;
|
||||
virtual bool get_user_prefers_integrated_gpu() const { return false; }
|
||||
|
||||
void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify = false, Logger::ErrorType p_type = Logger::ERR_ERROR);
|
||||
void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify = false, Logger::ErrorType p_type = Logger::ERR_ERROR, const Vector<Ref<ScriptBacktrace>> &p_script_backtraces = {});
|
||||
void print(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
|
||||
void print_rich(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
|
||||
void printerr(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
|
||||
|
|
@ -353,6 +352,8 @@ public:
|
|||
|
||||
virtual Error setup_remote_filesystem(const String &p_server_host, int p_port, const String &p_password, String &r_project_path);
|
||||
|
||||
void add_logger(Logger *p_logger);
|
||||
|
||||
enum PreferredTextureFormat {
|
||||
PREFERRED_TEXTURE_FORMAT_S3TC_BPTC,
|
||||
PREFERRED_TEXTURE_FORMAT_ETC2_ASTC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue