Skip to content
Permalink
Browse files

add more debugging output to mapserver

git-svn-id: http://svn.osgeo.org/qgis/trunk@15158 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Feb 12, 2011
1 parent fd6a988 commit 6dd4610a4d9df16e58658235fac8cdc603deb15c
Showing with 36 additions and 5 deletions.
  1. +25 −1 src/mapserver/qgis_map_serv.cpp
  2. +11 −4 src/mapserver/qgsmapserverlogger.cpp
@@ -41,7 +41,31 @@ map service syntax for SOAP/HTTP POST

void dummyMessageHandler( QtMsgType type, const char *msg )
{
//be quiet
#ifdef QGSMSDEBUG
QString output;

switch ( type )
{
case QtDebugMsg:
output += "Debug: ";
break;
case QtCriticalMsg:
output += "Critical: ";
break;
case QtWarningMsg:
output += "Warning: ";
break;
case QtFatalMsg:
output += "Fatal: ";
}

output += msg;

QgsMapServerLogger::instance()->printMessage( output );

if ( type == QtFatalMsg )
abort();
#endif
}

void printRequestInfos()
@@ -50,20 +50,27 @@ int QgsMapServerLogger::setLogFilePath( const QString& path )

void QgsMapServerLogger::printMessage( const QString& message )
{
if ( !mLogFile.isOpen() )
return;

mTextStream << message << endl;
}

void QgsMapServerLogger::printChar( QChar c )
{
if ( !mLogFile.isOpen() )
return;

mTextStream << c;
}

#ifdef QGSMSDEBUG
void QgsMapServerLogger::printMessage( const char *file, const char *function, int line, const QString& message )
{
mTextStream
<< QString( "%1: %2: (%3) " ).arg( file ).arg( function ).arg( line )
<< message
<< endl;
#if defined(_MSC_VER)
printMessage( QString( "%1(%2): (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( line ).arg( message ) );
#else
printMessage( QString( "%1: %2: (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( line ).arg( message ) );
#endif
}
#endif

0 comments on commit 6dd4610

Please sign in to comment.
You can’t perform that action at this time.