diff options
| author | Petr Mrázek <peterix@gmail.com> | 2015-02-02 02:14:14 +0100 |
|---|---|---|
| committer | Petr Mrázek <peterix@gmail.com> | 2015-04-12 20:57:17 +0200 |
| commit | cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5 (patch) | |
| tree | d8dd6499e29fbf5196b0d5a20f0a0da386b575bb /logic | |
| parent | 28a39ef7ac3e3dfe4ea65d02af01d1a18e3d4af6 (diff) | |
| download | PrismLauncher-cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5.tar.gz PrismLauncher-cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5.tar.bz2 PrismLauncher-cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5.zip | |
SCRATCH nuke the overcomplicated logger, use a simple one.
Diffstat (limited to 'logic')
52 files changed, 319 insertions, 319 deletions
diff --git a/logic/BaseProcess.cpp b/logic/BaseProcess.cpp index d65e76d9..eb1bbfdc 100644 --- a/logic/BaseProcess.cpp +++ b/logic/BaseProcess.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ #include "logic/BaseProcess.h" -#include "logger/QsLog.h" +#include <QDebug> #include <QDir> #include <QEventLoop> @@ -71,20 +71,20 @@ void BaseProcess::init() // filter out dangerous java crap if(ignored.contains(key)) { - QLOG_INFO() << "Env: ignoring" << key << value; + qDebug() << "Env: ignoring" << key << value; continue; } // filter MultiMC-related things if(key.startsWith("QT_")) { - QLOG_INFO() << "Env: ignoring" << key << value; + qDebug() << "Env: ignoring" << key << value; continue; } #ifdef LINUX // Do not pass LD_* variables to java. They were intended for MultiMC if(key.startsWith("LD_")) { - QLOG_INFO() << "Env: ignoring" << key << value; + qDebug() << "Env: ignoring" << key << value; continue; } // Strip IBus @@ -93,10 +93,10 @@ void BaseProcess::init() { QString save = value; value.replace(IBUS, ""); - QLOG_INFO() << "Env: stripped" << IBUS << "from" << save << ":" << value; + qDebug() << "Env: stripped" << IBUS << "from" << save << ":" << value; } #endif - QLOG_INFO() << "Env: " << key << value; + qDebug() << "Env: " << key << value; env.insert(key, value); } #ifdef LINUX diff --git a/logic/Env.cpp b/logic/Env.cpp index 68e76e4b..69986be2 100644 --- a/logic/Env.cpp +++ b/logic/Env.cpp @@ -6,7 +6,7 @@ #include <QDir> #include <QNetworkProxy> #include <QNetworkAccessManager> -#include "logger/QsLog.h" +#include <QDebug> #include "logic/tasks/Task.h" #include <QDebug> @@ -175,14 +175,14 @@ void Env::updateProxySettings(QString proxyTypeStr, QString addr, int port, QStr QNetworkProxyFactory::setUseSystemConfiguration(true); } - QLOG_INFO() << "Detecting proxy settings..."; + qDebug() << "Detecting proxy settings..."; QNetworkProxy proxy = QNetworkProxy::applicationProxy(); if (m_qnam.get()) m_qnam->setProxy(proxy); QString proxyDesc; if (proxy.type() == QNetworkProxy::NoProxy) { - QLOG_INFO() << "Using no proxy is an option!"; + qDebug() << "Using no proxy is an option!"; return; } switch (proxy.type()) @@ -211,7 +211,7 @@ void Env::updateProxySettings(QString proxyTypeStr, QString addr, int port, QStr .arg(proxy.port()) .arg(proxy.user()) .arg(proxy.password()); - QLOG_INFO() << proxyDesc; + qDebug() << proxyDesc; } #include "Env.moc"
\ No newline at end of file diff --git a/logic/InstanceList.cpp b/logic/InstanceList.cpp index 657fd5b4..ef6594d9 100644 --- a/logic/InstanceList.cpp +++ b/logic/InstanceList.cpp @@ -34,7 +34,7 @@ #include "settings/INISettingsObject.h" #include "OneSixInstance.h" #include "LegacyInstance.h" -#include "logger/QsLog.h" +#include <QDebug> const static int GROUP_FILE_FORMAT_VERSION = 1; @@ -138,7 +138,7 @@ void InstanceList::saveGroupList() if (!groupFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { // An error occurred. Ignore it. - QLOG_ERROR() << "Failed to save instance group file."; + qCritical() << "Failed to save instance group file."; return; } QTextStream out(&groupFile); @@ -202,7 +202,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) if (!groupFile.open(QIODevice::ReadOnly)) { // An error occurred. Ignore it. - QLOG_ERROR() << "Failed to read instance group file."; + qCritical() << "Failed to read instance group file."; return; } @@ -216,7 +216,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) // if the json was bad, fail if (error.error != QJsonParseError::NoError) { - QLOG_ERROR() << QString("Failed to parse instance group file: %1 at offset %2") + qCritical() << QString("Failed to parse instance group file: %1 at offset %2") .arg(error.errorString(), QString::number(error.offset)) .toUtf8(); return; @@ -225,7 +225,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) // if the root of the json wasn't an object, fail if (!jsonDoc.isObject()) { - QLOG_WARN() << "Invalid group file. Root entry should be an object."; + qWarning() << "Invalid group file. Root entry should be an object."; return; } @@ -238,7 +238,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) // Get the groups. if it's not an object, fail if (!rootObj.value("groups").isObject()) { - QLOG_WARN() << "Invalid group list JSON: 'groups' should be an object."; + qWarning() << "Invalid group list JSON: 'groups' should be an object."; return; } @@ -251,7 +251,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) // If not an object, complain and skip to the next one. if (!iter.value().isObject()) { - QLOG_WARN() << QString("Group '%1' in the group list should " + qWarning() << QString("Group '%1' in the group list should " "be an object.") .arg(groupName) .toUtf8(); @@ -261,7 +261,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) QJsonObject groupObj = iter.value().toObject(); if (!groupObj.value("instances").isArray()) { - QLOG_WARN() << QString("Group '%1' in the group list is invalid. " + qWarning() << QString("Group '%1' in the group list is invalid. " "It should contain an array " "called 'instances'.") .arg(groupName) @@ -298,7 +298,7 @@ InstanceList::InstListError InstanceList::loadList() QString subDir = iter.next(); if (!QFileInfo(PathCombine(subDir, "instance.cfg")).exists()) continue; - QLOG_INFO() << "Loading MultiMC instance from " << subDir; + qDebug() << "Loading MultiMC instance from " << subDir; InstancePtr instPtr; auto error = loadInstance(instPtr, subDir); if(!continueProcessInstance(instPtr, error, subDir, groupMap)) @@ -410,12 +410,12 @@ bool InstanceList::continueProcessInstance(InstancePtr instPtr, const int error, errorMsg += QString("Unknown instance loader error %1").arg(error); break; } - QLOG_ERROR() << errorMsg.toUtf8(); + qCritical() << errorMsg.toUtf8(); return false; } else if (!instPtr) { - QLOG_ERROR() << QString("Error loading instance %1. Instance loader returned null.") + qCritical() << QString("Error loading instance %1. Instance loader returned null.") .arg(QFileInfo(dir.absolutePath()).baseName()) .toUtf8(); return false; @@ -427,7 +427,7 @@ bool InstanceList::continueProcessInstance(InstancePtr instPtr, const int error, { instPtr->setGroupInitial((*iter)); } - QLOG_INFO() << "Loaded instance " << instPtr->name() << " from " << dir.absolutePath(); + qDebug() << "Loaded instance " << instPtr->name() << " from " << dir.absolutePath(); return true; } } @@ -463,16 +463,16 @@ InstanceList::createInstance(InstancePtr &inst, BaseVersionPtr version, const QS { QDir rootDir(instDir); - QLOG_DEBUG() << instDir.toUtf8(); + qDebug() << instDir.toUtf8(); if (!rootDir.exists() && !rootDir.mkpath(".")) { - QLOG_ERROR() << "Can't create instance folder" << instDir; + qCritical() << "Can't create instance folder" << instDir; return InstanceList::CantCreateDir; } if (!version) { - QLOG_ERROR() << "Can't create instance for non-existing MC version"; + qCritical() << "Can't create instance for non-existing MC version"; return InstanceList::NoSuchVersion; } @@ -497,7 +497,7 @@ InstanceList::copyInstance(InstancePtr &newInstance, InstancePtr &oldInstance, c { QDir rootDir(instDir); - QLOG_DEBUG() << instDir.toUtf8(); + qDebug() << instDir.toUtf8(); if (!copyPath(oldInstance->instanceRoot(), instDir)) { rootDir.removeRecursively(); diff --git a/logic/JarUtils.cpp b/logic/JarUtils.cpp index d4f1ed56..e73af53c 100644 --- a/logic/JarUtils.cpp +++ b/logic/JarUtils.cpp @@ -2,7 +2,7 @@ #include <quazip.h> #include <quazipfile.h> #include <JlCompress.h> -#include <logger/QsLog.h> +#include <QDebug> namespace JarUtils { @@ -19,13 +19,13 @@ bool mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained, QString filename = modZip.getCurrentFileName(); if (!filter(filename)) { - QLOG_INFO() << "Skipping file " << filename << " from " + qDebug() << "Skipping file " << filename << " from " << from.fileName() << " - filtered"; continue; } if (contained.contains(filename)) { - QLOG_INFO() << "Skipping already contained file " << filename << " from " + qDebug() << "Skipping already contained file " << filename << " from " << from.fileName(); continue; } @@ -33,7 +33,7 @@ bool mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained, if (!fileInsideMod.open(QIODevice::ReadOnly)) { - QLOG_ERROR() << "Failed to open " << filename << " from " << from.fileName(); + qCritical() << "Failed to open " << filename << " from " << from.fileName(); return false; } @@ -41,7 +41,7 @@ bool mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained, if (!zipOutFile.open(QIODevice::WriteOnly, info_out)) { - QLOG_ERROR() << "Failed to open " << filename << " in the jar"; + qCritical() << "Failed to open " << filename << " in the jar"; fileInsideMod.close(); return false; } @@ -49,7 +49,7 @@ bool mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained, { zipOutFile.close(); fileInsideMod.close(); - QLOG_ERROR() << "Failed to copy data of " << filename << " into the jar"; + qCritical() << "Failed to copy data of " << filename << " into the jar"; return false; } zipOutFile.close(); @@ -64,7 +64,7 @@ bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<M if (!zipOut.open(QuaZip::mdCreate)) { QFile::remove(targetJarPath); - QLOG_ERROR() << "Failed to open the minecraft.jar for modding"; + qCritical() << "Failed to open the minecraft.jar for modding"; return false; } // Files already added to the jar. @@ -86,7 +86,7 @@ bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<M { zipOut.close(); QFile::remove(targetJarPath); - QLOG_ERROR() << "Failed to add" << mod.filename().fileName() << "to the jar."; + qCritical() << "Failed to add" << mod.filename().fileName() << "to the jar."; return false; } } @@ -98,7 +98,7 @@ bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<M { zipOut.close(); QFile::remove(targetJarPath); - QLOG_ERROR() << "Failed to add" << mod.filename().fileName() << "to the jar."; + qCritical() << "Failed to add" << mod.filename().fileName() << "to the jar."; return false; } addedFiles.insert(filename.fileName()); @@ -114,10 +114,10 @@ bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<M { zipOut.close(); QFile::remove(targetJarPath); - QLOG_ERROR() << "Failed to add" << mod.filename().fileName() << "to the jar."; + qCritical() << "Failed to add" << mod.filename().fileName() << "to the jar."; return false; } - QLOG_INFO() << "Adding folder " << filename.fileName() << " from " + qDebug() << "Adding folder " << filename.fileName() << " from " << filename.absoluteFilePath(); } } @@ -126,7 +126,7 @@ bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<M { zipOut.close(); QFile::remove(targetJarPath); - QLOG_ERROR() << "Failed to insert minecraft.jar contents."; + qCritical() << "Failed to insert minecraft.jar contents."; return false; } @@ -135,7 +135,7 @@ bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<M if (zipOut.getZipError() != 0) { QFile::remove(targetJarPath); - QLOG_ERROR() << "Failed to finalize minecraft.jar!"; + qCritical() << "Failed to finalize minecraft.jar!"; return false; } return true; diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp index 11566866..1d4d6150 100644 --- a/logic/LegacyInstance.cpp +++ b/logic/LegacyInstance.cpp @@ -191,7 +191,7 @@ QList<Mod> LegacyInstance::getJarMods() const void LegacyInstance::jarModsChanged() { - QLOG_INFO() << "Jar mods of instance " << name() << " have changed. Jar will be rebuilt."; + qDebug() << "Jar mods of instance " << name() << " have changed. Jar will be rebuilt."; setShouldRebuild(true); } diff --git a/logic/LegacyUpdate.cpp b/logic/LegacyUpdate.cpp index e12556eb..8b970f08 100644 --- a/logic/LegacyUpdate.cpp +++ b/logic/LegacyUpdate.cpp @@ -28,7 +28,7 @@ #include "logic/Env.h" #include "logic/ModList.h" -#include "logger/QsLog.h" +#include <QDebug> #include "logic/net/URLConstants.h" #include "JarUtils.h" diff --git a/logic/LwjglVersionList.cpp b/logic/LwjglVersionList.cpp index 5bd9faa2..9e101b74 100644 --- a/logic/LwjglVersionList.cpp +++ b/logic/LwjglVersionList.cpp @@ -20,7 +20,7 @@ #include <QtXml> #include <QRegExp> -#include "logger/QsLog.h" +#include <QDebug> #define RSS_URL "http://sourceforge.net/projects/java-game-lib/rss" @@ -131,7 +131,7 @@ void LWJGLVersionList::netRequestComplete() QDomElement linkElement = getDomElementByTagName(items.at(i).toElement(), "link"); if (linkElement.isNull()) { - QLOG_INFO() << "Link element" << i << "in RSS feed doesn't exist! Skipping."; + qDebug() << "Link element" << i << "in RSS feed doesn't exist! Skipping."; continue; } @@ -147,10 +147,10 @@ void LWJGLVersionList::netRequestComplete() QUrl url(link); if (!url.isValid()) { - QLOG_WARN() << "LWJGL version URL isn't valid:" << link << "Skipping."; + qWarning() << "LWJGL version URL isn't valid:" << link << "Skipping."; continue; } - QLOG_INFO() << "Discovered LWGL version" << name << "at" << link; + qDebug() << "Discovered LWGL version" << name << "at" << link; tempList.append(std::make_shared<LWJGLVersion>(name, link)); } } @@ -159,7 +159,7 @@ void LWJGLVersionList::netRequestComplete() m_vlist.swap(tempList); endResetModel(); - QLOG_INFO() << "Loaded LWJGL list."; + qDebug() << "Loaded LWJGL list."; finished(); } else @@ -173,7 +173,7 @@ void LWJGLVersionList::netRequestComplete() void LWJGLVersionList::failed(QString msg) { - QLOG_ERROR() << msg; + qCritical() << msg; emit loadListFailed(msg); } diff --git a/logic/Mod.cpp b/logic/Mod.cpp index 7fdd2a5e..7fa4905e 100644 --- a/logic/Mod.cpp +++ b/logic/Mod.cpp @@ -25,7 +25,7 @@ #include "Mod.h" #include <pathutils.h> #include "logic/settings/INIFile.h" -#include "logger/QsLog.h" +#include <QDebug> Mod::Mod(const QFileInfo &file) { @@ -209,8 +209,8 @@ void Mod::ReadMCModInfo(QByteArray contents) int version = val.toDouble(); if (version != 2) { - QLOG_ERROR() << "BAD stuff happened to mod json:"; - QLOG_ERROR() << contents; + qCritical() << "BAD stuff happened to mod json:"; + qCritical() << contents; return; } auto arrVal = jsonDoc.object().value("modlist"); @@ -273,7 +273,7 @@ bool Mod::replace(Mod &with) if (t == MOD_ZIPFILE || t == MOD_SINGLEFILE || t == MOD_LITEMOD) { - QLOG_DEBUG() << "Copy: " << with.m_file.filePath() << " to " << m_file.filePath(); + qDebug() << "Copy: " << with.m_file.filePath() << " to " << m_file.filePath(); success = QFile::copy(with.m_file.filePath(), m_file.filePath()); } if (t == MOD_FOLDER) diff --git a/logic/ModList.cpp b/logic/ModList.cpp index f6037c95..68d74e79 100644 --- a/logic/ModList.cpp +++ b/logic/ModList.cpp @@ -21,7 +21,7 @@ #include <QUuid> #include <QString> #include <QFileSystemWatcher> -#include "logger/QsLog.h" +#include <QDebug> ModList::ModList(const QString &dir, const QString &list_file) : QAbstractListModel(), m_dir(dir), m_list_file(list_file) @@ -42,11 +42,11 @@ void ModList::startWatching() is_watching = m_watcher->addPath(m_dir.absolutePath()); if (is_watching) { - QLOG_INFO() << "Started watching " << m_dir.absolutePath(); + qDebug() << "Started watching " << m_dir.absolutePath(); } else { - QLOG_INFO() << "Failed to start watching " << m_dir.absolutePath(); + qDebug() << "Failed to start watching " << m_dir.absolutePath(); } } @@ -55,11 +55,11 @@ void ModList::stopWatching() is_watching = !m_watcher->removePath(m_dir.absolutePath()); if (!is_watching) { - QLOG_INFO() << "Stopped watching " << m_dir.absolutePath(); + qDebug() << "Stopped watching " << m_dir.absolutePath(); } else { - QLOG_INFO() << "Failed to stop watching " << m_dir.absolutePath(); + qDebug() << "Failed to stop watching " << m_dir.absolutePath(); } } @@ -162,7 +162,7 @@ bool ModList::update() endResetModel(); if (orderOrStateChanged && !m_list_file.isEmpty()) { - QLOG_INFO() << "Mod list " << m_list_file << " changed!"; + qDebug() << "Mod list " << m_list_file << " changed!"; saveListFile(); emit changed(); } @@ -559,7 +559,7 @@ bool ModList::dropMimeData(const QMimeData *data, Qt::DropAction action, int row row = rowCount(); if (column == -1) column = 0; - QLOG_INFO() << "Drop row: " << row << " column: " << column; + qDebug() << "Drop row: " << row << " column: " << column; // files dropped from outside? if (data->hasUrls()) @@ -575,7 +575,7 @@ bool ModList::dropMimeData(const QMimeData *data, Qt::DropAction action, int row continue; QString filename = url.toLocalFile(); installMod(filename, row); - QLOG_INFO() << "installing: " << filename; + qDebug() << "installing: " << filename; // if there is no ordering, re-sort the list if (m_list_file.isEmpty()) { @@ -596,7 +596,7 @@ bool ModList::dropMimeData(const QMimeData *data, Qt::DropAction action, int row return false; QString remoteId = list[0]; int remoteIndex = list[1].toInt(); - QLOG_INFO() << "move: " << sourcestr; + qDebug() << "move: " << sourcestr; // no moving of things between two lists if (remoteId != m_list_id) return false; diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index bdd47131..642a6aec 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -15,7 +15,7 @@ #include <QIcon> #include <pathutils.h> -#include "logger/QsLog.h" +#include <QDebug> #include "MMCError.h" #include "logic/OneSixInstance.h" diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp index 38e9c0d7..5ec36305 100644 --- a/logic/OneSixUpdate.cpp +++ b/logic/OneSixUpdate.cpp @@ -60,14 +60,14 @@ void OneSixUpdate::executeTask() } if (m_inst->providesVersionFile() || !targetVersion->needsUpdate()) { - QLOG_DEBUG() << "Instance either provides a version file or doesn't need an update."; + qDebug() << "Instance either provides a version file or doesn't need an update."; jarlibStart(); return; } versionUpdateTask = std::dynamic_pointer_cast<MinecraftVersionList>(ENV.getVersionList("net.minecraft"))->createUpdateTask(m_inst->intendedVersionId()); if (!versionUpdateTask) { - QLOG_DEBUG() << "Didn't spawn an update task."; + qDebug() << "Didn't spawn an update task."; jarlibStart(); return; } @@ -173,7 +173,7 @@ void OneSixUpdate::assetsFailed() void OneSixUpdate::jarlibStart() { setStatus(tr("Getting the library files from Mojang...")); - QLOG_INFO() << m_inst->name() << ": downloading libraries"; + qDebug() << m_inst->name() << ": downloading libraries"; OneSixInstance *inst = (OneSixInstance *)m_inst; try { diff --git a/logic/assets/AssetsUtils.cpp b/logic/assets/AssetsUtils.cpp index 82a0da95..9f33b1bd 100644 --- a/logic/assets/AssetsUtils.cpp +++ b/logic/assets/AssetsUtils.cpp @@ -20,7 +20,7 @@ #include <QJsonDocument> #include <QJsonObject> #include <QVariant> |
