mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Merge branch 'develop' into fix-log-level-bleed
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
commit
4f5e348b66
35 changed files with 135 additions and 157 deletions
|
|
@ -60,7 +60,7 @@ std::optional<LogParser::LogEntry> LogParser::parseAttributes()
|
|||
entry.timestamp = QDateTime::fromSecsSinceEpoch(value.trimmed().toLongLong());
|
||||
} else if (name == "level"_L1) {
|
||||
entry.levelText = value.trimmed().toString();
|
||||
entry.level = MessageLevel::getLevel(entry.levelText);
|
||||
entry.level = messageLevelFromName(entry.levelText);
|
||||
} else if (name == "thread"_L1) {
|
||||
entry.thread = value.trimmed().toString();
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ std::optional<LogParser::ParsedItem> LogParser::parseLog4J()
|
|||
throw std::runtime_error("unreachable: already verified this was a complete log4j:Event");
|
||||
}
|
||||
|
||||
MessageLevel::Enum LogParser::guessLevel(const QString& line, MessageLevel::Enum previous)
|
||||
MessageLevel LogParser::guessLevel(const QString& line, MessageLevel previous)
|
||||
{
|
||||
static const QRegularExpression LINE_WITH_LEVEL("^\\[(?<timestamp>[0-9:]+)\\] \\[[^/]+/(?<level>[^\\]]+)\\]");
|
||||
auto match = LINE_WITH_LEVEL.match(line);
|
||||
|
|
@ -329,7 +329,7 @@ MessageLevel::Enum LogParser::guessLevel(const QString& line, MessageLevel::Enum
|
|||
QString timestamp = match.captured("timestamp");
|
||||
QString levelStr = match.captured("level");
|
||||
|
||||
return MessageLevel::getLevel(levelStr);
|
||||
return messageLevelFromName(levelStr);
|
||||
} else {
|
||||
// Old style forge logs
|
||||
if (line.contains("[INFO]") || line.contains("[CONFIG]") || line.contains("[FINE]") || line.contains("[FINER]") ||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class LogParser {
|
|||
public:
|
||||
struct LogEntry {
|
||||
QString logger;
|
||||
MessageLevel::Enum level;
|
||||
MessageLevel level;
|
||||
QString levelText;
|
||||
QDateTime timestamp;
|
||||
QString thread;
|
||||
|
|
@ -59,7 +59,7 @@ class LogParser {
|
|||
std::optional<Error> getError();
|
||||
|
||||
/// guess log level from a line of game log
|
||||
static MessageLevel::Enum guessLevel(const QString& line, MessageLevel::Enum previous);
|
||||
static MessageLevel guessLevel(const QString& line, MessageLevel previous);
|
||||
|
||||
protected:
|
||||
std::optional<LogEntry> parseAttributes();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue