GH-926 implement log cleaning functionality

Also adds gzip compressed log support
This commit is contained in:
Petr Mrázek
2015-08-18 02:25:24 +02:00
parent 4e3af265da
commit 96fdaebb5c
19 changed files with 447 additions and 53 deletions

View File

@ -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"

View File

@ -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);
};