1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge branch 'pr619'

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-11-04 08:17:27 +01:00
commit 932f70ae51
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -53,11 +53,18 @@ int main(int argc, char *argv[])
logFile = new QTextStream;
dflt = qInstallMessageHandler(nullptr);
QFile logfile(QDir(Settings::getSettingsDirPath()).filePath("qtox.log"));
logfile.open(QIODevice::Append);
logFile->setDevice(&logfile);
*logFile << QDateTime::currentDateTime().toString("yyyy-dd-MM HH:mm:ss' file logger starting\n'");
qInstallMessageHandler(myMessageHandler);
if (logfile.open(QIODevice::Append))
{
logFile->setDevice(&logfile);
*logFile << QDateTime::currentDateTime().toString("\nyyyy-dd-MM HH:mm:ss' file logger starting\n'");
qInstallMessageHandler(myMessageHandler);
}
else
{
fprintf(stderr, "Couldn't open log file!!!\n");
delete logFile;
logFile = nullptr;
}
#endif
// Windows platform plugins DLL hell fix