Log: Simplify macros

This commit is contained in:
Stenzek
2024-05-23 20:55:28 +10:00
parent 792717e03e
commit 4e922a34a7
144 changed files with 2273 additions and 2363 deletions

View File

@ -292,7 +292,7 @@ void LogWindow::logCallback(void* pUserParam, const char* channelName, const cha
qmessage.append(QUtf8StringView(message.data(), message.length()));
qmessage.append(QChar('\n'));
const QLatin1StringView qchannel((level <= LOGLEVEL_PERF) ? functionName : channelName);
const QLatin1StringView qchannel((level <= LOGLEVEL_WARNING) ? functionName : channelName);
if (g_emu_thread->isOnUIThread())
{
@ -331,16 +331,14 @@ void LogWindow::appendMessage(const QLatin1StringView& channel, quint32 level, c
temp_cursor.movePosition(QTextCursor::End);
{
static constexpr const QChar level_characters[LOGLEVEL_COUNT] = {'X', 'E', 'W', 'P', 'I', 'V', 'D', 'R', 'B', 'T'};
static constexpr const QChar level_characters[LOGLEVEL_COUNT] = {'X', 'E', 'W', 'I', 'V', 'D', 'B', 'T'};
static constexpr const QColor level_colors[LOGLEVEL_COUNT] = {
QColor(255, 255, 255), // NONE
QColor(0xE7, 0x48, 0x56), // ERROR, Red Intensity
QColor(0xF9, 0xF1, 0xA5), // WARNING, Yellow Intensity
QColor(0xB4, 0x00, 0x9E), // PERF, Purple Intensity
QColor(0xF2, 0xF2, 0xF2), // INFO, White Intensity
QColor(0x16, 0xC6, 0x0C), // VERBOSE, Green Intensity
QColor(0xCC, 0xCC, 0xCC), // DEV, White
QColor(0x61, 0xD6, 0xD6), // PROFILE, Cyan Intensity
QColor(0x13, 0xA1, 0x0E), // DEBUG, Green
QColor(0x00, 0x37, 0xDA), // TRACE, Blue
};
@ -358,7 +356,7 @@ void LogWindow::appendMessage(const QLatin1StringView& channel, quint32 level, c
temp_cursor.insertText(qtimestamp);
}
const QString qchannel = (level <= LOGLEVEL_PERF) ?
const QString qchannel = (level <= LOGLEVEL_WARNING) ?
QStringLiteral("%1(%2): ").arg(level_characters[level]).arg(channel) :
QStringLiteral("%1/%2: ").arg(level_characters[level]).arg(channel);
format.setForeground(QBrush(channel_color));