Improve Console window output.

-> Log Pre- and Post-Launch command happenings
-> Enable the java part to specify the level

TODO: fix logging with mc 1.7's log4j logging infrastructure

Signed-off-by: Orochimarufan <orochimarufan.x3@gmail.com>
This commit is contained in:
Orochimarufan
2014-01-17 22:55:10 +01:00
parent 7b96d74d3b
commit 188d0d5886
10 changed files with 249 additions and 83 deletions

View File

@@ -31,11 +31,12 @@ enum Enum
{
MultiMC, /**< MultiMC Messages */
Debug, /**< Debug Messages */
Info, /**< Info Messages */
Info, /**< Info Messages */
Message, /**< Standard Messages */
Warning, /**< Warnings */
Error, /**< Errors */
Fatal /**< Fatal Errors */
Fatal, /**< Fatal Errors */
PrePost, /**< Pre/Post Launch command output */
};
}
@@ -125,9 +126,17 @@ slots:
void finish(int, QProcess::ExitStatus status);
void on_stdErr();
void on_stdOut();
void on_prepost_stdOut();
void on_prepost_stdErr();
void logOutput(const QStringList &lines,
MessageLevel::Enum defaultLevel = MessageLevel::Message,
bool guessLevel = true, bool censor = true);
void logOutput(QString line,
MessageLevel::Enum defaultLevel = MessageLevel::Message,
bool guessLevel = true, bool censor = true);
private:
QString censorPrivateInfo(QString in);
MessageLevel::Enum getLevel(const QString &message, MessageLevel::Enum defaultLevel);
MessageLevel::Enum guessLevel(const QString &message, MessageLevel::Enum defaultLevel);
MessageLevel::Enum getLevel(const QString &levelName);
};