From be12e18983a2bc57f382f7f601c8eb6ff2db6c36 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 1 Feb 2016 16:51:31 -0500 Subject: [PATCH] Fix up the log function so that now it will actually create/save the log. --- src/server/LogManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/LogManager.cpp b/src/server/LogManager.cpp index 39e1025..c62b544 100644 --- a/src/server/LogManager.cpp +++ b/src/server/LogManager.cpp @@ -14,15 +14,16 @@ void LogManager::log(QString file, QStringList msgs, QDateTime time){ qDebug() << "Log to File:" << file << msgs; if(file.isEmpty()){ return; } QFile LOG(file); - if( !LOG.open(QIODevice::WriteOnly, QIODevice::Append) ){ qDebug() << " - Could not write to log:" << file; return; } //error writing to file + //if(!LOG.exists()){ system( QString("touch "+file).toLocal8Bit() ); } + if( !LOG.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text) ){ qDebug() << " - Could not write to log:" << file; return; } //error writing to file QTextStream stream(&LOG); for(int i=0; i