- Modified log filename and folder.
This commit is contained in:
parent
4d31605318
commit
fdf73f25d5
8 changed files with 45 additions and 2378 deletions
10
src/main.cpp
10
src/main.cpp
|
@ -19,6 +19,7 @@
|
|||
#include <QApplication>
|
||||
#include "libremediaserver.h"
|
||||
|
||||
// Handler for pipe the stderr to a log file
|
||||
void MessageHandler(QtMsgType type, const char *msg)
|
||||
{
|
||||
QString txt;
|
||||
|
@ -36,7 +37,14 @@ void MessageHandler(QtMsgType type, const char *msg)
|
|||
txt = QString("Fatal: %1").arg(msg);
|
||||
abort();
|
||||
}
|
||||
QFile outFile("log.txt");
|
||||
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);
|
||||
QTextStream ts(&outFile);
|
||||
ts << txt << endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue