mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
troubleshooter: update formatting (#490)
## Link to GitHub Issue, if one exists n/a ## Description of change Make the text color cyan to make the messages stand out. ## Testing Verified in terminal.
This commit is contained in:
@@ -12,9 +12,11 @@
|
||||
#include "launcher/launcher.h"
|
||||
#include "util/utils.h"
|
||||
|
||||
#define FOREGROUND_GREY (8)
|
||||
#define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN)
|
||||
#define FOREGROUND_YELLOW (FOREGROUND_RED | FOREGROUND_GREEN)
|
||||
#define FOREGROUND_GREY (8)
|
||||
#define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN)
|
||||
#define FOREGROUND_YELLOW (FOREGROUND_RED | FOREGROUND_GREEN)
|
||||
#define FOREGROUND_CYAN (FOREGROUND_GREEN | FOREGROUND_BLUE)
|
||||
#define FOREGROUND_MAGENTA (FOREGROUND_RED | FOREGROUND_BLUE)
|
||||
|
||||
namespace logger {
|
||||
|
||||
@@ -103,9 +105,6 @@ namespace logger {
|
||||
last_style = content.second;
|
||||
|
||||
switch (content.second) {
|
||||
case Style::DEFAULT:
|
||||
set_console_color(hTerminal, FOREGROUND_WHITE);
|
||||
break;
|
||||
case Style::GREY:
|
||||
set_console_color(hTerminal, FOREGROUND_GREY);
|
||||
break;
|
||||
@@ -115,6 +114,13 @@ namespace logger {
|
||||
case Style::RED:
|
||||
set_console_color(hTerminal, FOREGROUND_RED);
|
||||
break;
|
||||
case Style::SPECIAL:
|
||||
set_console_color(hTerminal, FOREGROUND_CYAN);
|
||||
break;
|
||||
case Style::DEFAULT:
|
||||
default:
|
||||
set_console_color(hTerminal, FOREGROUND_WHITE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ namespace logger {
|
||||
DEFAULT = 0,
|
||||
GREY = 1,
|
||||
YELLOW = 2,
|
||||
RED = 3
|
||||
RED = 3,
|
||||
SPECIAL = 4,
|
||||
};
|
||||
|
||||
void start();
|
||||
|
||||
@@ -76,8 +76,8 @@ namespace deferredlogs {
|
||||
msg += "\n";
|
||||
}
|
||||
|
||||
for (auto messages : errors) {
|
||||
for (auto message : messages) {
|
||||
for (const auto &messages : errors) {
|
||||
for (const auto &message : messages) {
|
||||
msg += " " + message + "\n";
|
||||
}
|
||||
msg += "\n";
|
||||
@@ -91,7 +91,7 @@ namespace deferredlogs {
|
||||
msg += "\n";
|
||||
msg += "\\------------------------- spice2x auto-troubleshooter ------------------------/\n";
|
||||
|
||||
log_warning("troubleshooter", "{}", msg);
|
||||
log_special("troubleshooter", "{}", msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,9 @@ void show_popup_for_fatal_error(std::string message);
|
||||
#define log_warning(module, format_str, ...) logger::push( \
|
||||
LOG_FORMAT("W", module, format_str, ## __VA_ARGS__), logger::Style::YELLOW)
|
||||
|
||||
#define log_special(module, format_str, ...) logger::push( \
|
||||
LOG_FORMAT("W", module, format_str, ## __VA_ARGS__), logger::Style::SPECIAL)
|
||||
|
||||
#define log_fatal(module, format_str, ...) { \
|
||||
logger::push(LOG_FORMAT("F", module, format_str, ## __VA_ARGS__), logger::Style::RED); \
|
||||
show_popup_for_fatal_error(LOG_FORMAT_POPUP(module, format_str, ## __VA_ARGS__)); \
|
||||
|
||||
Reference in New Issue
Block a user