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/forge | |
parent | 28a39ef7ac3e3dfe4ea65d02af01d1a18e3d4af6 (diff) | |
download | MultiMC-cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5.tar MultiMC-cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5.tar.gz MultiMC-cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5.tar.lz MultiMC-cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5.tar.xz MultiMC-cd9d37aac402b0edd0f12b66fd7f2fdd5fe6dff5.zip |
SCRATCH nuke the overcomplicated logger, use a simple one.
Diffstat (limited to 'logic/forge')
-rw-r--r-- | logic/forge/ForgeInstaller.cpp | 8 | ||||
-rw-r--r-- | logic/forge/ForgeMirrors.cpp | 6 | ||||
-rw-r--r-- | logic/forge/ForgeVersionList.cpp | 12 | ||||
-rw-r--r-- | logic/forge/ForgeXzDownload.cpp | 36 |
4 files changed, 31 insertions, 31 deletions
diff --git a/logic/forge/ForgeInstaller.cpp b/logic/forge/ForgeInstaller.cpp index 19cecaeb..b6fb426a 100644 --- a/logic/forge/ForgeInstaller.cpp +++ b/logic/forge/ForgeInstaller.cpp @@ -181,7 +181,7 @@ bool ForgeInstaller::add(OneSixInstance *to) // mark bad libraries based on the xzlist above for (auto entry : xzlist) { - QLOG_DEBUG() << "Testing " << rawName << " : " << entry; + qDebug() << "Testing " << rawName << " : " << entry; if (rawName.startsWith(entry)) { lib->setHint("forge-pack-xz"); @@ -260,7 +260,7 @@ bool ForgeInstaller::add(OneSixInstance *to) QFile file(filename(to->instanceRoot())); if (!file.open(QFile::WriteOnly)) { - QLOG_ERROR() << "Error opening" << file.fileName() + qCritical() << "Error opening" << file.fileName() << "for reading:" << file.errorString(); return false; } @@ -314,7 +314,7 @@ bool ForgeInstaller::addLegacy(OneSixInstance *to) QFile file(filename(to->instanceRoot())); if (!file.open(QFile::WriteOnly)) { - QLOG_ERROR() << "Error opening" << file.fileName() + qCritical() << "Error opening" << file.fileName() << "for reading:" << file.errorString(); return false; } @@ -352,7 +352,7 @@ protected: { if (!install(entry, forgeVersion)) { - QLOG_ERROR() << "Failure installing forge"; + qCritical() << "Failure installing forge"; emitFailed(tr("Failure to install forge")); } else diff --git a/logic/forge/ForgeMirrors.cpp b/logic/forge/ForgeMirrors.cpp index bb50d0b7..06abb88f 100644 --- a/logic/forge/ForgeMirrors.cpp +++ b/logic/forge/ForgeMirrors.cpp @@ -1,6 +1,6 @@ #include "logic/Env.h" #include "ForgeMirrors.h" -#include "logger/QsLog.h" +#include <QDebug> #include <algorithm> #include <random> @@ -15,7 +15,7 @@ ForgeMirrors::ForgeMirrors(QList<ForgeXzDownloadPtr> &libs, NetJobPtr parent_job void ForgeMirrors::start() { - QLOG_INFO() << "Downloading " << m_url.toString(); + qDebug() << "Downloading " << m_url.toString(); QNetworkRequest request(m_url); request.setHeader(QNetworkRequest::UserAgentHeader, "MultiMC/5.0 (Uncached)"); auto worker = ENV.qnam(); @@ -33,7 +33,7 @@ void ForgeMirrors::start() void ForgeMirrors::downloadError(QNetworkReply::NetworkError error) { // error happened during download. - QLOG_ERROR() << "Error getting URL:" << m_url.toString().toLocal8Bit() + qCritical() << "Error getting URL:" << m_url.toString().toLocal8Bit() << "Network error: " << error; m_status = Job_Failed; } diff --git a/logic/forge/ForgeVersionList.cpp b/logic/forge/ForgeVersionList.cpp index d7bb8af2..260f84eb 100644 --- a/logic/forge/ForgeVersionList.cpp +++ b/logic/forge/ForgeVersionList.cpp @@ -23,7 +23,7 @@ #include <QtXml> #include <QRegExp> -#include "logger/QsLog.h" +#include <QDebug> ForgeVersionList::ForgeVersionList(QObject *parent) : BaseVersionList(parent) { @@ -338,7 +338,7 @@ bool ForgeListLoadTask::parseForgeGradleList(QList<BaseVersionPtr> &out) fVersion->m_buildnr = number.value("build").toDouble(); if(fVersion->m_buildnr >= 953 && fVersion->m_buildnr <= 965) { - QLOG_DEBUG() << fVersion->m_buildnr; + qDebug() << fVersion->m_buildnr; } fVersion->jobbuildver = number.value("version").toString(); fVersion->branch = number.value("branch").toString(""); @@ -437,11 +437,11 @@ void ForgeListLoadTask::listFailed() auto reply = listDownload->m_reply; if (reply) { - QLOG_ERROR() << "Getting forge version list failed: " << reply->errorString(); + qCritical() << "Getting forge version list failed: " << reply->errorString(); } else { - QLOG_ERROR() << "Getting forge version list failed for reasons unknown."; + qCritical() << "Getting forge version list failed for reasons unknown."; } } @@ -450,10 +450,10 @@ void ForgeListLoadTask::gradleListFailed() auto reply = gradleListDownload->m_reply; if (reply) { - QLOG_ERROR() << "Getting forge version list failed: " << reply->errorString(); + qCritical() << "Getting forge version list failed: " << reply->errorString(); } else { - QLOG_ERROR() << "Getting forge version list failed for reasons unknown."; + qCritical() << "Getting forge version list failed for reasons unknown."; } } diff --git a/logic/forge/ForgeXzDownload.cpp b/logic/forge/ForgeXzDownload.cpp index c2e5f76e..ac2c4b1f 100644 --- a/logic/forge/ForgeXzDownload.cpp +++ b/logic/forge/ForgeXzDownload.cpp @@ -21,7 +21,7 @@ #include <QFileInfo> #include <QDateTime> #include <QDir> -#include "logger/QsLog.h" +#include <QDebug> ForgeXzDownload::ForgeXzDownload(QString relative_path, MetaEntryPtr entry) : NetAction() { @@ -62,7 +62,7 @@ void ForgeXzDownload::start() return; } - QLOG_INFO() << "Downloading " << m_url.toString(); + qDebug() << "Downloading " << m_url.toString(); QNetworkRequest request(m_url); request.setRawHeader(QString("If-None-Match").toLatin1(), m_entry->etag.toLatin1()); request.setHeader(QNetworkRequest::UserAgentHeader, "MultiMC/5.0 (Cached)"); @@ -108,10 +108,10 @@ void ForgeXzDownload::failAndTryNextMirror() void ForgeXzDownload::updateUrl() { - QLOG_INFO() << "Updating URL for " << m_url_path; + qDebug() << "Updating URL for " << m_url_path; for (auto possible : m_mirrors) { - QLOG_INFO() << "Possible: " << possible.name << " : " << possible.mirror_url; + qDebug() << "Possible: " << possible.name << " : " << possible.mirror_url; } QString aggregate = m_mirrors[m_mirror_index].mirror_url + m_url_path + ".pack.xz"; m_url = QUrl(aggregate); @@ -121,10 +121,10 @@ void ForgeXzDownload::downloadFinished() { //TEST: defer to other possible mirrors (autofail the first one) /* - QLOG_INFO() <<"dl " << index_within_job << " mirror " << m_mirror_index; + qDebug() <<"dl " << index_within_job << " mirror " << m_mirror_index; if( m_mirror_index == 0) { - QLOG_INFO() <<"dl " << index_within_job << " AUTOFAIL"; + qDebug() <<"dl " << index_within_job << " AUTOFAIL"; m_status = Job_Failed; m_pack200_xz_file.close(); m_pack200_xz_file.remove(); @@ -270,38 +270,38 @@ void ForgeXzDownload::decompressAndInstall() break; case XZ_MEM_ERROR: - QLOG_ERROR() << "Memory allocation failed\n"; + qCritical() << "Memory allocation failed\n"; xz_dec_end(s); failAndTryNextMirror(); return; case XZ_MEMLIMIT_ERROR: - QLOG_ERROR() << "Memory usage limit reached\n"; + qCritical() << "Memory usage limit reached\n"; xz_dec_end(s); failAndTryNextMirror(); return; case XZ_FORMAT_ERROR: - QLOG_ERROR() << "Not a .xz file\n"; + qCritical() << "Not a .xz file\n"; xz_dec_end(s); failAndTryNextMirror(); return; case XZ_OPTIONS_ERROR: - QLOG_ERROR() << "Unsupported options in the .xz headers\n"; + qCritical() << "Unsupported options in the .xz headers\n"; xz_dec_end(s); failAndTryNextMirror(); return; case XZ_DATA_ERROR: case XZ_BUF_ERROR: - QLOG_ERROR() << "File is corrupt\n"; + qCritical() << "File is corrupt\n"; xz_dec_end(s); failAndTryNextMirror(); return; default: - QLOG_ERROR() << "Bug!\n"; + qCritical() << "Bug!\n"; xz_dec_end(s); failAndTryNextMirror(); return; @@ -316,35 +316,35 @@ void ForgeXzDownload::decompressAndInstall() // FIXME: dispose of file handles, pointers and the like. Ideally wrap in objects. if(handle_in == -1) { - QLOG_ERROR() << "Error reopening " << pack200_file.fileName(); + qCritical() << "Error reopening " << pack200_file.fileName(); failAndTryNextMirror(); return; } FILE * file_in = fdopen(handle_in,"r"); if(!file_in) { - QLOG_ERROR() << "Error reopening " << pack200_file.fileName(); + qCritical() << "Error reopening " << pack200_file.fileName(); failAndTryNextMirror(); return; } QFile qfile_out(m_target_path); if(!qfile_out.open(QIODevice::WriteOnly)) { - QLOG_ERROR() << "Error opening " << qfile_out.fileName(); + qCritical() << "Error opening " << qfile_out.fileName(); failAndTryNextMirror(); return; } int handle_out = qfile_out.handle(); if(handle_out == -1) { - QLOG_ERROR() << "Error opening " << qfile_out.fileName(); + qCritical() << "Error opening " << qfile_out.fileName(); failAndTryNextMirror(); return; } FILE * file_out = fdopen(handle_out,"w"); if(!file_out) { - QLOG_ERROR() << "Error opening " << qfile_out.fileName(); + qCritical() << "Error opening " << qfile_out.fileName(); failAndTryNextMirror(); return; } @@ -355,7 +355,7 @@ void ForgeXzDownload::decompressAndInstall() catch (std::runtime_error &err) { m_status = Job_Failed; - QLOG_ERROR() << "Error unpacking " << pack200_file.fileName() << " : " << err.what(); + qCritical() << "Error unpacking " << pack200_file.fileName() << " : " << err.what(); QFile f(m_target_path); if (f.exists()) f.remove(); |