Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mapserver: use default message handler for debugging output on windows
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15186 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 17, 2011
1 parent a4caa92 commit 41bafb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mapserver/qgis_map_serv.cpp
Expand Up @@ -130,7 +130,9 @@ QFileInfo defaultAdminSLD()

int main( int argc, char * argv[] )
{
#ifndef _MSC_VER
qInstallMsgHandler( dummyMessageHandler );
#endif

QgsApplication qgsapp( argc, argv, false );

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

// 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
Expand Down
9 changes: 9 additions & 0 deletions src/mapserver/qgsmapserverlogger.cpp
Expand Up @@ -17,6 +17,10 @@

#include "qgsmapserverlogger.h"

#ifdef _MSC_VER
#include <windows.h>
#endif

QgsMapServerLogger* QgsMapServerLogger::mInstance = 0;

QgsMapServerLogger::QgsMapServerLogger()
Expand Down Expand Up @@ -51,7 +55,12 @@ int QgsMapServerLogger::setLogFilePath( const QString& path )
void QgsMapServerLogger::printMessage( const QString& message )
{
if ( !mLogFile.isOpen() )
{
#ifdef _MSC_VER
::OutputDebugString( message.toLocal8Bit() );
#endif
return;
}

mTextStream << message << endl;
}
Expand Down

0 comments on commit 41bafb0

Please sign in to comment.