From b1e8f08ebe17ec58a013e6d6ac3e65d8d45d5b58 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Fri, 8 Jan 2010 18:32:23 +0100 Subject: [PATCH] save server output to a file --- servatrice/src/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/servatrice/src/main.cpp b/servatrice/src/main.cpp index 072290be..6294aa6d 100644 --- a/servatrice/src/main.cpp +++ b/servatrice/src/main.cpp @@ -22,8 +22,19 @@ #include #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[]) { + qInstallMsgHandler(myMessageOutput); + QCoreApplication app(argc, argv); app.setOrganizationName("Cockatrice"); app.setApplicationName("Servatrice");