GH-926 implement log cleaning functionality
Also adds gzip compressed log support
This commit is contained in:
@ -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"
|
||||
|
@ -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);
|
||||
};
|
||||
|
Reference in New Issue
Block a user