- Updated Gem sources to Gem project. Compiled Gem and pix2jpg.
This commit is contained in:
parent
0ce5174bec
commit
5b47c73cce
31 changed files with 421 additions and 1153 deletions
30
src/main.cpp
30
src/main.cpp
|
@ -20,6 +20,10 @@
|
|||
#include "libremediaserver.h"
|
||||
|
||||
// Handler for pipe the stderr to a log file
|
||||
|
||||
bool initMessageHandler = 0;
|
||||
QFile outFile;
|
||||
|
||||
void MessageHandler(QtMsgType type, const char *msg)
|
||||
{
|
||||
QString txt;
|
||||
|
@ -37,15 +41,23 @@ void MessageHandler(QtMsgType type, const char *msg)
|
|||
txt = QString("Fatal: %1").arg(msg);
|
||||
abort();
|
||||
}
|
||||
QString filename;
|
||||
QDate date = QDate::currentDate();
|
||||
QTime time = QTime::currentTime();
|
||||
filename.append("./logs/log_");
|
||||
filename.append(date.toString("dd_MM_yy-"));
|
||||
filename.append(time.toString("hh-mm-ss"));
|
||||
filename.append(".txt");
|
||||
QFile outFile(filename);
|
||||
outFile.open(QIODevice::WriteOnly | QIODevice::Append);
|
||||
if (!initMessageHandler)
|
||||
{
|
||||
QString filename;
|
||||
QDate date = QDate::currentDate();
|
||||
QTime time = QTime::currentTime();
|
||||
filename.append("./logs/log_");
|
||||
filename.append(date.toString("dd_MM_yy-"));
|
||||
filename.append(time.toString("hh-mm-ss"));
|
||||
filename.append(".txt");
|
||||
outFile.setFileName(filename);
|
||||
if (!outFile.open(QIODevice::WriteOnly | QIODevice::Append))
|
||||
{
|
||||
qDebug()<<"main/MessageHandler/Qfile::open: can not open log file";
|
||||
return;
|
||||
}
|
||||
initMessageHandler = 1;
|
||||
}
|
||||
QTextStream ts(&outFile);
|
||||
ts << txt << endl;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue