1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
This commit is contained in:
dubslow 2014-11-03 19:08:02 -06:00
parent ac6f581142
commit 46b08f8850

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