mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-22 15:16:15 -08:00
save server output to a file
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user