example/AuthApp/main.cpp
changeset 17 106a4bfcb866
parent 14 a469c0e6e7fb
--- a/example/AuthApp/main.cpp	Thu Aug 05 16:35:33 2010 +0530
+++ b/example/AuthApp/main.cpp	Thu Aug 05 16:46:37 2010 +0530
@@ -33,9 +33,42 @@
 #include <QtGui>
 #include <QApplication>
 
+void debugOutput(QtMsgType type, const char *msg)
+	{
+	QFile logFile("c://data//FaceBookLog.txt");
+	Q_ASSERT(logFile.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append ));
+	QTextStream stream(&logFile);
+	
+	switch (type)
+		{
+		case QtDebugMsg:
+			stream<<msg<<"\n";
+			break;
+
+		case QtWarningMsg:
+			stream<<"Warning: ";
+			stream<<msg<<"\n";
+			break;
+			
+		case QtCriticalMsg:
+			stream<<"Critical: ";
+			stream<<msg<<"\n";
+			break;
+			
+		case QtFatalMsg:
+			stream<<"Fatal: ";
+			stream<<msg<<"\n";
+			break;
+			
+		default:;
+		}
+	}
+
 int main(int argc, char *argv[])
 {
+	qInstallMsgHandler(debugOutput);
     QApplication a(argc, argv);
+    qDebug()<<"Inside main()";
     AuthApp w;
     
 	#if defined(Q_OS_SYMBIAN)