Nice error output padding. Code location behind " At: " is now aligned with the error message above. Also removed the dot after the file location.
This commit is contained in:
parent
42beb83178
commit
a5683def19
2 changed files with 20 additions and 12 deletions
|
@ -1779,15 +1779,15 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l
|
||||||
switch(p_type) {
|
switch(p_type) {
|
||||||
case ERR_ERROR:
|
case ERR_ERROR:
|
||||||
print("ERROR: %s: %s\n", p_function, err_details);
|
print("ERROR: %s: %s\n", p_function, err_details);
|
||||||
print(" At: %s:%i.\n", p_file, p_line);
|
print(" At: %s:%i\n", p_file, p_line);
|
||||||
break;
|
break;
|
||||||
case ERR_WARNING:
|
case ERR_WARNING:
|
||||||
print("WARNING: %s: %s\n", p_function, err_details);
|
print("WARNING: %s: %s\n", p_function, err_details);
|
||||||
print(" At: %s:%i.\n", p_file, p_line);
|
print(" At: %s:%i\n", p_file, p_line);
|
||||||
break;
|
break;
|
||||||
case ERR_SCRIPT:
|
case ERR_SCRIPT:
|
||||||
print("SCRIPT ERROR: %s: %s", p_function, err_details);
|
print("SCRIPT ERROR: %s: %s", p_function, err_details);
|
||||||
print(" At: %s:%i.\n", p_file, p_line);
|
print(" At: %s:%i\n", p_file, p_line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1818,13 +1818,17 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l
|
||||||
}
|
}
|
||||||
|
|
||||||
SetConsoleTextAttribute(hCon, current_fg | current_bg | FOREGROUND_INTENSITY);
|
SetConsoleTextAttribute(hCon, current_fg | current_bg | FOREGROUND_INTENSITY);
|
||||||
print(" %s\n", p_rationale);
|
print("%s\n", p_rationale);
|
||||||
|
|
||||||
SetConsoleTextAttribute(hCon, basecol);
|
SetConsoleTextAttribute(hCon, basecol);
|
||||||
print("At: ");
|
switch (p_type) {
|
||||||
|
case ERR_ERROR: print(" At: "); break;
|
||||||
|
case ERR_WARNING: print(" At: "); break;
|
||||||
|
case ERR_SCRIPT: print(" At: "); break;
|
||||||
|
}
|
||||||
|
|
||||||
SetConsoleTextAttribute(hCon, current_fg | current_bg);
|
SetConsoleTextAttribute(hCon, current_fg | current_bg);
|
||||||
print(" %s:%i\n", p_file, p_line);
|
print("%s:%i\n", p_file, p_line);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1836,13 +1840,17 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l
|
||||||
}
|
}
|
||||||
|
|
||||||
SetConsoleTextAttribute(hCon, current_fg | current_bg | FOREGROUND_INTENSITY);
|
SetConsoleTextAttribute(hCon, current_fg | current_bg | FOREGROUND_INTENSITY);
|
||||||
print(" %s\n", p_code);
|
print("%s\n", p_code);
|
||||||
|
|
||||||
SetConsoleTextAttribute(hCon, basecol);
|
SetConsoleTextAttribute(hCon, basecol);
|
||||||
print("At: ");
|
switch (p_type) {
|
||||||
|
case ERR_ERROR: print(" At: "); break;
|
||||||
|
case ERR_WARNING: print(" At: "); break;
|
||||||
|
case ERR_SCRIPT: print(" At: "); break;
|
||||||
|
}
|
||||||
|
|
||||||
SetConsoleTextAttribute(hCon, current_fg | current_bg);
|
SetConsoleTextAttribute(hCon, current_fg | current_bg);
|
||||||
print(" %s:%i\n", p_file, p_line);
|
print("%s:%i\n", p_file, p_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetConsoleTextAttribute(hCon, sbi.wAttributes);
|
SetConsoleTextAttribute(hCon, sbi.wAttributes);
|
||||||
|
|
|
@ -434,15 +434,15 @@ void OSWinrt::print_error(const char* p_function, const char* p_file, int p_line
|
||||||
switch(p_type) {
|
switch(p_type) {
|
||||||
case ERR_ERROR:
|
case ERR_ERROR:
|
||||||
print("ERROR: %s: %s\n", p_function, err_details);
|
print("ERROR: %s: %s\n", p_function, err_details);
|
||||||
print(" At: %s:%i.\n", p_file, p_line);
|
print(" At: %s:%i\n", p_file, p_line);
|
||||||
break;
|
break;
|
||||||
case ERR_WARNING:
|
case ERR_WARNING:
|
||||||
print("WARNING: %s: %s\n", p_function, err_details);
|
print("WARNING: %s: %s\n", p_function, err_details);
|
||||||
print(" At: %s:%i.\n", p_file, p_line);
|
print(" At: %s:%i\n", p_file, p_line);
|
||||||
break;
|
break;
|
||||||
case ERR_SCRIPT:
|
case ERR_SCRIPT:
|
||||||
print("SCRIPT ERROR: %s: %s", p_function, err_details);
|
print("SCRIPT ERROR: %s: %s", p_function, err_details);
|
||||||
print(" At: %s:%i.\n", p_file, p_line);
|
print(" At: %s:%i\n", p_file, p_line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue