save server output to a file
This commit is contained in:
parent
ce4f8e20a0
commit
b1e8f08ebe
1 changed files with 11 additions and 0 deletions
|
@ -22,8 +22,19 @@
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include "servatrice.h"
|
#include "servatrice.h"
|
||||||
|
|
||||||
|
void myMessageOutput(QtMsgType /*type*/, const char *msg)
|
||||||
|
{
|
||||||
|
static FILE *f = NULL;
|
||||||
|
if (!f)
|
||||||
|
f = fopen("qdebug.txt", "w");
|
||||||
|
fprintf(f, "%s\n", msg);
|
||||||
|
fflush(f);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
qInstallMsgHandler(myMessageOutput);
|
||||||
|
|
||||||
QCoreApplication app(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
app.setOrganizationName("Cockatrice");
|
app.setOrganizationName("Cockatrice");
|
||||||
app.setApplicationName("Servatrice");
|
app.setApplicationName("Servatrice");
|
||||||
|
|
Loading…
Reference in a new issue