[QGIS Commit] r15186 - trunk/qgis/src/mapserver

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Feb 17 18:45:50 EST 2011


Author: jef
Date: 2011-02-17 15:45:50 -0800 (Thu, 17 Feb 2011)
New Revision: 15186

Modified:
   trunk/qgis/src/mapserver/qgis_map_serv.cpp
   trunk/qgis/src/mapserver/qgsmapserverlogger.cpp
Log:
mapserver: use default message handler for debugging output on windows

Modified: trunk/qgis/src/mapserver/qgis_map_serv.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgis_map_serv.cpp	2011-02-17 22:33:13 UTC (rev 15185)
+++ trunk/qgis/src/mapserver/qgis_map_serv.cpp	2011-02-17 23:45:50 UTC (rev 15186)
@@ -130,7 +130,9 @@
 
 int main( int argc, char * argv[] )
 {
+#ifndef _MSC_VER
   qInstallMsgHandler( dummyMessageHandler );
+#endif
 
   QgsApplication qgsapp( argc, argv, false );
 
@@ -150,7 +152,7 @@
 
   // Instantiate the plugin directory so that providers are loaded
   QgsProviderRegistry::instance( QgsApplication::pluginPath() );
-#ifdef QGSMSDEBUG
+#ifdef QGSMSDEBUG && !_MSC_VER
   //write to qgis_wms_server.log in application directory
   QgsMapServerLogger::instance()->setLogFilePath( qgsapp.applicationDirPath() + "/qgis_wms_server.log" );
 #endif

Modified: trunk/qgis/src/mapserver/qgsmapserverlogger.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgsmapserverlogger.cpp	2011-02-17 22:33:13 UTC (rev 15185)
+++ trunk/qgis/src/mapserver/qgsmapserverlogger.cpp	2011-02-17 23:45:50 UTC (rev 15186)
@@ -17,6 +17,10 @@
 
 #include "qgsmapserverlogger.h"
 
+#ifdef _MSC_VER
+#include <windows.h>
+#endif
+
 QgsMapServerLogger* QgsMapServerLogger::mInstance = 0;
 
 QgsMapServerLogger::QgsMapServerLogger()
@@ -51,7 +55,12 @@
 void QgsMapServerLogger::printMessage( const QString& message )
 {
   if ( !mLogFile.isOpen() )
+  {
+#ifdef _MSC_VER
+    ::OutputDebugString( message.toLocal8Bit() );
+#endif
     return;
+  }
 
   mTextStream << message << endl;
 }



More information about the QGIS-commit mailing list