Revert "GH-1665 diagnostic build - disable file logging entirely"

This reverts commit 0493170936.
This commit is contained in:
Petr Mrázek 2016-10-27 17:00:34 +02:00
parent 0493170936
commit 2c2c1b0a17

View File

@ -429,13 +429,11 @@ void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QSt
QString out = format.arg(buf).arg(levels[type]).arg(msg); QString out = format.arg(buf).arg(levels[type]).arg(msg);
/*
if(MMC->logFile && MMC->logFile->isOpen()) if(MMC->logFile && MMC->logFile->isOpen())
{ {
MMC->logFile->write(out.toUtf8()); MMC->logFile->write(out.toUtf8());
MMC->logFile->flush(); MMC->logFile->flush();
} }
*/
QTextStream(stderr) << out.toLocal8Bit(); QTextStream(stderr) << out.toLocal8Bit();
fflush(stderr); fflush(stderr);
} }
@ -453,7 +451,7 @@ void MultiMC::initLogger()
logFile = std::make_shared<QFile>(logBase.arg(0)); logFile = std::make_shared<QFile>(logBase.arg(0));
logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate); logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
if(!logFile->isOpen()) if(!logFile || !logFile->isOpen())
{ {
QTextStream(stderr) << "Couldn't open log file for writing: " << logBase.arg(0).toLocal8Bit(); QTextStream(stderr) << "Couldn't open log file for writing: " << logBase.arg(0).toLocal8Bit();
fflush(stderr); fflush(stderr);