diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-11-18 18:58:22 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-11-18 18:58:22 -0300 |
commit | f7389065193646a1903c59fe6b35c37e6b6a4543 (patch) | |
tree | ac7ba93d6df124a43de94a2d8edc8bbf2405f541 /core | |
parent | ef6fab88be8e5fef600cf5700c04879eeb4524e0 (diff) | |
parent | 9ab7de243fe0348c46a87c03b1fce15b8e1afeb3 (diff) |
Merge pull request #2737 from akien-mga/type-specific-error-output
Display error type (error, warning, script error) in OS::print_error + cleanup error ANSI coloring
Diffstat (limited to 'core')
-rw-r--r-- | core/os/os.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index ee9f12b79d..8caf95e4d1 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -61,9 +61,16 @@ void OS::debug_break() { void OS::print_error(const char* p_function,const char* p_file,int p_line,const char *p_code,const char*p_rationale,ErrorType p_type) { + const char* err_type; + switch(p_type) { + case ERR_ERROR: err_type="**ERROR**"; break; + case ERR_WARNING: err_type="**WARNING**"; break; + case ERR_SCRIPT: err_type="**SCRIPT ERROR**"; break; + } + if (p_rationale && *p_rationale) - print("**ERROR**: %s\n ",p_rationale); - print("**ERROR**: At: %s:%i:%s() - %s\n",p_file,p_line,p_function,p_code); + print("%s: %s\n ",err_type,p_rationale); + print("%s: At: %s:%i:%s() - %s\n",err_type,p_file,p_line,p_function,p_code); } void OS::print(const char* p_format, ...) { |