Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 committed Feb 12, 2011
1 parent fd6a988 commit 6dd4610
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
26 changes: 25 additions & 1 deletion src/mapserver/qgis_map_serv.cpp
Expand Up @@ -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()
Expand Down
15 changes: 11 additions & 4 deletions src/mapserver/qgsmapserverlogger.cpp
Expand Up @@ -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.