Skip to content

Commit

Permalink
Fix server debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed May 5, 2014
1 parent 57b450a commit 9d05631
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core/qgslogger.h
Expand Up @@ -118,11 +118,12 @@ class CORE_EXPORT QgsLogger
/** Logs the message passed in to the logfile defined in QGIS_LOG_FILE if any. **/
static void logMessageToFile( QString theMessage );

private:
/**Reads the environment variable QGIS_LOG_FILE. Returns NULL if the variable is not set,
* otherwise returns a file name for writing log messages to.*/
static const QString logFile();

private:

/**Reads the environment variable QGIS_DEBUG_FILE. Returns NULL if the variable is not set.
* If set, only messages from this source file will be sent to logs. */
static const char* debugFile();
Expand Down
9 changes: 7 additions & 2 deletions src/mapserver/qgis_map_serv.cpp
Expand Up @@ -283,14 +283,19 @@ int main( int argc, char * argv[] )
QgsMapRenderer* theMapRenderer = new QgsMapRenderer();
theMapRenderer->setLabelingEngine( new QgsPalLabeling() );

printRequestInfos();

#ifdef QGSMSDEBUG
QgsFontUtils::loadStandardTestFonts( QStringList() << "Roman" << "Bold" );
#endif

QString logFile = QgsLogger::logFile();

while ( fcgi_accept() >= 0 )
{
if ( !logFile.isEmpty() )
{
setenv( "QGIS_LOG_FILE", logFile.toLocal8Bit().data(), 1 );
}

printRequestInfos(); //print request infos if in debug mode

//Request handler
Expand Down

0 comments on commit 9d05631

Please sign in to comment.