Skip to content

Commit 9217cfe

Browse files
author
jef
committed
mapserver: use default message handler for debugging output on windows
git-svn-id: http://svn.osgeo.org/qgis/trunk@15186 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a1e1ec9 commit 9217cfe

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/mapserver/qgis_map_serv.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ QFileInfo defaultAdminSLD()
130130

131131
int main( int argc, char * argv[] )
132132
{
133+
#ifndef _MSC_VER
133134
qInstallMsgHandler( dummyMessageHandler );
135+
#endif
134136

135137
QgsApplication qgsapp( argc, argv, false );
136138

@@ -150,7 +152,7 @@ int main( int argc, char * argv[] )
150152

151153
// Instantiate the plugin directory so that providers are loaded
152154
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
153-
#ifdef QGSMSDEBUG
155+
#ifdef QGSMSDEBUG && !_MSC_VER
154156
//write to qgis_wms_server.log in application directory
155157
QgsMapServerLogger::instance()->setLogFilePath( qgsapp.applicationDirPath() + "/qgis_wms_server.log" );
156158
#endif

src/mapserver/qgsmapserverlogger.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
#include "qgsmapserverlogger.h"
1919

20+
#ifdef _MSC_VER
21+
#include <windows.h>
22+
#endif
23+
2024
QgsMapServerLogger* QgsMapServerLogger::mInstance = 0;
2125

2226
QgsMapServerLogger::QgsMapServerLogger()
@@ -51,7 +55,12 @@ int QgsMapServerLogger::setLogFilePath( const QString& path )
5155
void QgsMapServerLogger::printMessage( const QString& message )
5256
{
5357
if ( !mLogFile.isOpen() )
58+
{
59+
#ifdef _MSC_VER
60+
::OutputDebugString( message.toLocal8Bit() );
61+
#endif
5462
return;
63+
}
5564

5665
mTextStream << message << endl;
5766
}

0 commit comments

Comments
 (0)