Multiple simultaneous request support to Communication
[qtmeetings] / src / main.cpp
1 #include <iostream>
2 #include <fstream> 
3 #include <QApplication>
4 #include <QTime>
5 #include "WindowManager.h"
6
7 using namespace std;
8
9 ofstream logfile;
10
11 void DebugOutputHandler( QtMsgType type, const char *msg ) {
12     switch( type ) {
13         case QtDebugMsg:
14             logfile << QTime::currentTime().toString().toAscii().data() << " Debug: " << msg << "\n";
15             logfile.flush();
16             break;
17         case QtCriticalMsg:
18             logfile << QTime::currentTime().toString().toAscii().data() << " Critical: " << msg << "\n";
19             logfile.flush();
20             break;
21         case QtWarningMsg:
22             logfile << QTime::currentTime().toString().toAscii().data() << " Warning: " << msg << "\n";
23             logfile.flush();
24             break;
25         case QtFatalMsg:
26             logfile << QTime::currentTime().toString().toAscii().data() <<  " Fatal: " << msg << "\n";
27             logfile.flush();
28     }
29 }
30
31 int main( int argc, char *argv[] )
32 {
33         #ifdef DEBUG_OUTPUT_TO_FILE
34         logfile.open( "/tmp/qtmeetings.log", ios::app );
35         qInstallMsgHandler( DebugOutputHandler );
36         #endif
37         
38         QApplication app( argc, argv );
39         WindowManager *windowManager = new WindowManager;
40         return app.exec();
41 }