diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-08-18 02:25:24 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-08-18 08:51:12 +0200 |
commit | 96fdaebb5c8c8902c98c1fb43e755cf90fc15198 (patch) | |
tree | bb4e1ace6bb0800a5991884d5f07b41267699283 /logic/minecraft | |
parent | 4e3af265dad57a27af4051cb574fb90539d287d0 (diff) | |
download | MultiMC-96fdaebb5c8c8902c98c1fb43e755cf90fc15198.tar MultiMC-96fdaebb5c8c8902c98c1fb43e755cf90fc15198.tar.gz MultiMC-96fdaebb5c8c8902c98c1fb43e755cf90fc15198.tar.lz MultiMC-96fdaebb5c8c8902c98c1fb43e755cf90fc15198.tar.xz MultiMC-96fdaebb5c8c8902c98c1fb43e755cf90fc15198.zip |
GH-926 implement log cleaning functionality
Also adds gzip compressed log support
Diffstat (limited to 'logic/minecraft')
-rw-r--r-- | logic/minecraft/MinecraftInstance.cpp | 10 | ||||
-rw-r--r-- | logic/minecraft/MinecraftInstance.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/logic/minecraft/MinecraftInstance.cpp b/logic/minecraft/MinecraftInstance.cpp index d576ef4f..50962452 100644 --- a/logic/minecraft/MinecraftInstance.cpp +++ b/logic/minecraft/MinecraftInstance.cpp @@ -5,6 +5,8 @@ #include "Env.h" #include "minecraft/MinecraftVersionList.h" #include <MMCStrings.h> +#include <pathmatcher/RegexpMatcher.h> +#include <pathmatcher/MultiMatcher.h> #define IBUS "@im=ibus" @@ -277,4 +279,12 @@ MessageLevel::Enum MinecraftInstance::guessLevel(const QString &line, MessageLev return level; } +IPathMatcher::Ptr MinecraftInstance::getLogFileMatcher() +{ + auto combined = std::make_shared<MultiMatcher>(); + combined->add(std::make_shared<RegexpMatcher>(".*\\.log(\\.[0-9]*)?(\\.gz)?$")); + combined->add(std::make_shared<RegexpMatcher>("crash-.*\\.txt")); + return combined; +} + #include "MinecraftInstance.moc" diff --git a/logic/minecraft/MinecraftInstance.h b/logic/minecraft/MinecraftInstance.h index 14a0f097..a09e44db 100644 --- a/logic/minecraft/MinecraftInstance.h +++ b/logic/minecraft/MinecraftInstance.h @@ -44,6 +44,8 @@ public: /// guess log level from a line of minecraft log virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level); + virtual IPathMatcher::Ptr getLogFileMatcher() override; + protected: QMap<QString, QString> createCensorFilterFromSession(AuthSessionPtr session); }; |