Skip to content

Commit d967b71

Browse files
committedJun 10, 2011
Obsoleted QgsMSLogger as it duplicates functionality from QgsLogger
1 parent 2fe16b5 commit d967b71

21 files changed

+231
-369
lines changed
 

‎src/mapserver/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ SET ( qgis_mapserv_SRCS
2929
qgssldrenderer.cpp
3030
qgswmsserver.cpp
3131
qgsmapserviceexception.cpp
32-
qgsmapserverlogger.cpp
3332
qgsmslayercache.cpp
3433
qgsfilter.cpp
3534
qgssldrule.cpp

‎src/mapserver/qgis_map_serv.cpp

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ map service syntax for SOAP/HTTP POST
2323
#include "qgsgetrequesthandler.h"
2424
#include "qgssoaprequesthandler.h"
2525
#include "qgsproviderregistry.h"
26-
#include "qgsmapserverlogger.h"
26+
#include "qgslogger.h"
2727
#include "qgswmsserver.h"
2828
#include "qgsmaprenderer.h"
2929
#include "qgsmapserviceexception.h"
@@ -62,7 +62,7 @@ void dummyMessageHandler( QtMsgType type, const char *msg )
6262

6363
output += msg;
6464

65-
QgsMapServerLogger::instance()->printMessage( output );
65+
QgsDebugMsg( output );
6666

6767
if ( type == QtFatalMsg )
6868
abort();
@@ -73,44 +73,44 @@ void printRequestInfos()
7373
{
7474
#ifdef QGSMSDEBUG
7575
//print out some infos about the request
76-
QgsMSDebugMsg( "************************new request**********************" );
77-
QgsMSDebugMsg( QDateTime::currentDateTime().toString( "yyyy-MM-dd hh:mm:ss" ) );
76+
QgsDebugMsg( "************************new request**********************" );
77+
QgsDebugMsg( QDateTime::currentDateTime().toString( "yyyy-MM-dd hh:mm:ss" ) );
7878

7979
if ( getenv( "REMOTE_ADDR" ) != NULL )
8080
{
81-
QgsMSDebugMsg( "remote ip: " + QString( getenv( "REMOTE_ADDR" ) ) );
81+
QgsDebugMsg( "remote ip: " + QString( getenv( "REMOTE_ADDR" ) ) );
8282
}
8383
if ( getenv( "REMOTE_HOST" ) != NULL )
8484
{
85-
QgsMSDebugMsg( "remote host: " + QString( getenv( "REMOTE_HOST" ) ) );
85+
QgsDebugMsg( "remote host: " + QString( getenv( "REMOTE_HOST" ) ) );
8686
}
8787
if ( getenv( "REMOTE_USER" ) != NULL )
8888
{
89-
QgsMSDebugMsg( "remote user: " + QString( getenv( "REMOTE_USER" ) ) );
89+
QgsDebugMsg( "remote user: " + QString( getenv( "REMOTE_USER" ) ) );
9090
}
9191
if ( getenv( "REMOTE_IDENT" ) != NULL )
9292
{
93-
QgsMSDebugMsg( "REMOTE_IDENT: " + QString( getenv( "REMOTE_IDENT" ) ) );
93+
QgsDebugMsg( "REMOTE_IDENT: " + QString( getenv( "REMOTE_IDENT" ) ) );
9494
}
9595
if ( getenv( "CONTENT_TYPE" ) != NULL )
9696
{
97-
QgsMSDebugMsg( "CONTENT_TYPE: " + QString( getenv( "CONTENT_TYPE" ) ) );
97+
QgsDebugMsg( "CONTENT_TYPE: " + QString( getenv( "CONTENT_TYPE" ) ) );
9898
}
9999
if ( getenv( "AUTH_TYPE" ) != NULL )
100100
{
101-
QgsMSDebugMsg( "AUTH_TYPE: " + QString( getenv( "AUTH_TYPE" ) ) );
101+
QgsDebugMsg( "AUTH_TYPE: " + QString( getenv( "AUTH_TYPE" ) ) );
102102
}
103103
if ( getenv( "HTTP_USER_AGENT" ) != NULL )
104104
{
105-
QgsMSDebugMsg( "HTTP_USER_AGENT: " + QString( getenv( "HTTP_USER_AGENT" ) ) );
105+
QgsDebugMsg( "HTTP_USER_AGENT: " + QString( getenv( "HTTP_USER_AGENT" ) ) );
106106
}
107107
#endif //QGSMSDEBUG
108108
}
109109

110110
QFileInfo defaultProjectFile()
111111
{
112112
QDir currentDir;
113-
QgsMSDebugMsg( "current directory: " + currentDir.absolutePath() );
113+
QgsDebugMsg( "current directory: " + currentDir.absolutePath() );
114114
fprintf( FCGI_stderr, "current directory: %s\n", currentDir.absolutePath().toUtf8().constData() );
115115
QStringList nameFilterList;
116116
nameFilterList << "*.qgs";
@@ -163,16 +163,12 @@ int main( int argc, char * argv[] )
163163

164164
// Instantiate the plugin directory so that providers are loaded
165165
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
166-
#if defined(QGSMSDEBUG) && !defined(_MSC_VER)
167-
//write to qgis_wms_server.log in application directory
168-
QgsMapServerLogger::instance()->setLogFilePath( qgsapp.applicationDirPath() + "/qgis_wms_server.log" );
169-
#endif
170-
QgsMSDebugMsg( "Prefix PATH: " + QgsApplication::prefixPath() );
171-
QgsMSDebugMsg( "Plugin PATH: " + QgsApplication::pluginPath() );
172-
QgsMSDebugMsg( "PkgData PATH: " + QgsApplication::pkgDataPath() );
173-
QgsMSDebugMsg( "User DB PATH: " + QgsApplication::qgisUserDbFilePath() );
166+
QgsDebugMsg( "Prefix PATH: " + QgsApplication::prefixPath() );
167+
QgsDebugMsg( "Plugin PATH: " + QgsApplication::pluginPath() );
168+
QgsDebugMsg( "PkgData PATH: " + QgsApplication::pkgDataPath() );
169+
QgsDebugMsg( "User DB PATH: " + QgsApplication::qgisUserDbFilePath() );
174170

175-
QgsMSDebugMsg( qgsapp.applicationDirPath() + "/qgis_wms_server.log" );
171+
QgsDebugMsg( qgsapp.applicationDirPath() + "/qgis_wms_server.log" );
176172

177173
//create config cache and search for config files in the current directory.
178174
//These configurations are used if no mapfile parameter is present in the request
@@ -208,18 +204,18 @@ int main( int argc, char * argv[] )
208204
{
209205
if ( strcmp( requestMethod, "POST" ) == 0 )
210206
{
211-
QgsMSDebugMsg( "Creating QgsSOAPRequestHandler" );
207+
QgsDebugMsg( "Creating QgsSOAPRequestHandler" );
212208
theRequestHandler = new QgsSOAPRequestHandler();
213209
}
214210
else
215211
{
216-
QgsMSDebugMsg( "Creating QgsGetRequestHandler" );
212+
QgsDebugMsg( "Creating QgsGetRequestHandler" );
217213
theRequestHandler = new QgsGetRequestHandler();
218214
}
219215
}
220216
else
221217
{
222-
QgsMSDebugMsg( "Creating QgsGetRequestHandler" );
218+
QgsDebugMsg( "Creating QgsGetRequestHandler" );
223219
theRequestHandler = new QgsGetRequestHandler();
224220
}
225221

@@ -231,7 +227,7 @@ int main( int argc, char * argv[] )
231227
}
232228
catch ( QgsMapServiceException& e )
233229
{
234-
QgsMSDebugMsg( "An exception was thrown during input parsing" );
230+
QgsDebugMsg( "An exception was thrown during input parsing" );
235231
theRequestHandler->sendServiceException( e );
236232
continue;
237233
}
@@ -247,7 +243,7 @@ int main( int argc, char * argv[] )
247243
QgsConfigParser* adminConfigParser = QgsConfigCache::instance()->searchConfiguration( configFilePath );
248244
if ( !adminConfigParser )
249245
{
250-
QgsMSDebugMsg( "parse error on config file " + configFilePath );
246+
QgsDebugMsg( "parse error on config file " + configFilePath );
251247
theRequestHandler->sendServiceException( QgsMapServiceException( "", "Configuration file problem : perhaps you left off the .qgs extension?" ) );
252248
continue;
253249
}
@@ -260,7 +256,7 @@ int main( int argc, char * argv[] )
260256
if ( serviceIt == parameterMap.end() )
261257
{
262258
//tell the user that service parameter is mandatory
263-
QgsMSDebugMsg( "unable to find 'SERVICE' parameter, exiting..." );
259+
QgsDebugMsg( "unable to find 'SERVICE' parameter, exiting..." );
264260
theRequestHandler->sendServiceException( QgsMapServiceException( "ServiceNotSpecified", "Service not specified. The SERVICE parameter is mandatory" ) );
265261
delete theRequestHandler;
266262
continue;
@@ -285,7 +281,7 @@ int main( int argc, char * argv[] )
285281
if ( requestIt == parameterMap.end() )
286282
{
287283
//do some error handling
288-
QgsMSDebugMsg( "unable to find 'REQUEST' parameter, exiting..." );
284+
QgsDebugMsg( "unable to find 'REQUEST' parameter, exiting..." );
289285
theRequestHandler->sendServiceException( QgsMapServiceException( "OperationNotSupported", "Please check the value of the REQUEST parameter" ) );
290286
delete theRequestHandler;
291287
delete theServer;
@@ -297,7 +293,7 @@ int main( int argc, char * argv[] )
297293
const QDomDocument* capabilitiesDocument = capabilitiesCache.searchCapabilitiesDocument( configFilePath );
298294
if ( !capabilitiesDocument ) //capabilities xml not in cache. Create a new one
299295
{
300-
QgsMSDebugMsg( "Capabilities document not found in cache" );
296+
QgsDebugMsg( "Capabilities document not found in cache" );
301297
QDomDocument doc;
302298
try
303299
{
@@ -315,7 +311,7 @@ int main( int argc, char * argv[] )
315311
}
316312
else
317313
{
318-
QgsMSDebugMsg( "Found capabilities document in cache" );
314+
QgsDebugMsg( "Found capabilities document in cache" );
319315
}
320316

321317
if ( capabilitiesDocument )
@@ -335,7 +331,7 @@ int main( int argc, char * argv[] )
335331
}
336332
catch ( QgsMapServiceException& ex )
337333
{
338-
QgsMSDebugMsg( "Catched exception during GetMap request" );
334+
QgsDebugMsg( "Catched exception during GetMap request" );
339335
theRequestHandler->sendServiceException( ex );
340336
delete theRequestHandler;
341337
delete theServer;
@@ -344,13 +340,13 @@ int main( int argc, char * argv[] )
344340

345341
if ( result )
346342
{
347-
QgsMSDebugMsg( "Sending GetMap response" );
343+
QgsDebugMsg( "Sending GetMap response" );
348344
theRequestHandler->sendGetMapResponse( serviceIt->second, result );
349345
}
350346
else
351347
{
352348
//do some error handling
353-
QgsMSDebugMsg( "result image is 0" );
349+
QgsDebugMsg( "result image is 0" );
354350
}
355351
delete result;
356352
delete theRequestHandler;
@@ -420,14 +416,14 @@ int main( int argc, char * argv[] )
420416

421417
if ( result )
422418
{
423-
QgsMSDebugMsg( "Sending GetLegendGraphics response" );
419+
QgsDebugMsg( "Sending GetLegendGraphics response" );
424420
//sending is the same for GetMap and GetLegendGraphics
425421
theRequestHandler->sendGetMapResponse( serviceIt->second, result );
426422
}
427423
else
428424
{
429425
//do some error handling
430-
QgsMSDebugMsg( "result image is 0" );
426+
QgsDebugMsg( "result image is 0" );
431427
}
432428
delete result;
433429
delete theRequestHandler;

‎src/mapserver/qgscapabilitiescache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
***************************************************************************/
1717

1818
#include "qgscapabilitiescache.h"
19-
#include "qgsmapserverlogger.h"
19+
#include "qgslogger.h"
2020
#include <QCoreApplication>
2121

2222
QgsCapabilitiesCache::QgsCapabilitiesCache()
@@ -57,7 +57,7 @@ void QgsCapabilitiesCache::insertCapabilitiesDocument( const QString& configFile
5757

5858
void QgsCapabilitiesCache::removeChangedEntry( const QString& path )
5959
{
60-
QgsMSDebugMsg( "Remove capabilities cache entry because file changed" );
60+
QgsDebugMsg( "Remove capabilities cache entry because file changed" );
6161
QHash< QString, QDomDocument >::iterator it = mCachedCapabilities.find( path );
6262
if ( it != mCachedCapabilities.end() )
6363
{

‎src/mapserver/qgsconfigcache.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
***************************************************************************/
1717

1818
#include "qgsconfigcache.h"
19-
#include "qgsmapserverlogger.h"
19+
#include "qgslogger.h"
2020
#include "qgsmslayercache.h"
2121
#include "qgsprojectparser.h"
2222
#include "qgssldparser.h"
@@ -54,12 +54,12 @@ QgsConfigParser* QgsConfigCache::searchConfiguration( const QString& filePath )
5454
QHash<QString, QgsConfigParser*>::const_iterator configIt = mCachedConfigurations.find( filePath );
5555
if ( configIt == mCachedConfigurations.constEnd() )
5656
{
57-
QgsMSDebugMsg( "Create new configuration" );
57+
QgsDebugMsg( "Create new configuration" );
5858
p = insertConfiguration( filePath );
5959
}
6060
else
6161
{
62-
QgsMSDebugMsg( "Return configuration from cache" );
62+
QgsDebugMsg( "Return configuration from cache" );
6363
p = configIt.value();
6464
}
6565

@@ -89,7 +89,7 @@ QgsConfigParser* QgsConfigCache::insertConfiguration( const QString& filePath )
8989
QFile* configFile = new QFile( filePath );
9090
if ( !configFile->exists() || !configFile->open( QIODevice::ReadOnly ) )
9191
{
92-
QgsMSDebugMsg( "File unreadable: " + filePath );
92+
QgsDebugMsg( "File unreadable: " + filePath );
9393
delete configFile;
9494
return 0;
9595
}
@@ -100,7 +100,7 @@ QgsConfigParser* QgsConfigCache::insertConfiguration( const QString& filePath )
100100
int line, column;
101101
if ( !configDoc->setContent( configFile, true, &errorMsg, &line, &column ) )
102102
{
103-
QgsMSDebugMsg( QString( "Parse error %1 at row %2, column %3 in %4 " )
103+
QgsDebugMsg( QString( "Parse error %1 at row %2, column %3 in %4 " )
104104
.arg( errorMsg ).arg( line ).arg( column ).arg( filePath ) );
105105
delete configFile;
106106
delete configDoc;
@@ -120,7 +120,7 @@ QgsConfigParser* QgsConfigCache::insertConfiguration( const QString& filePath )
120120
}
121121
else
122122
{
123-
QgsMSDebugMsg( "SLD or qgis expected in " + filePath );
123+
QgsDebugMsg( "SLD or qgis expected in " + filePath );
124124
delete configDoc;
125125
return 0;
126126
}
@@ -133,7 +133,7 @@ QgsConfigParser* QgsConfigCache::insertConfiguration( const QString& filePath )
133133

134134
void QgsConfigCache::removeChangedEntry( const QString& path )
135135
{
136-
QgsMSDebugMsg( "Remove config cache entry because file changed" );
136+
QgsDebugMsg( "Remove config cache entry because file changed" );
137137
QHash<QString, QgsConfigParser*>::iterator configIt = mCachedConfigurations.find( path );
138138
if ( configIt != mCachedConfigurations.end() )
139139
{

‎src/mapserver/qgsgetrequesthandler.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "qgsgetrequesthandler.h"
22
#include "qgsftptransaction.h"
3-
#include "qgsmapserverlogger.h"
3+
#include "qgslogger.h"
44
#include "qgsmapserviceexception.h"
55
#include "qgsremotedatasourcebuilder.h"
66
#include "qgshttptransaction.h"
@@ -24,11 +24,11 @@ std::map<QString, QString> QgsGetRequestHandler::parseInput()
2424
if ( qs )
2525
{
2626
queryString = QString( qs );
27-
QgsMSDebugMsg( "query string is: " + queryString );
27+
QgsDebugMsg( "query string is: " + queryString );
2828
}
2929
else
3030
{
31-
QgsMSDebugMsg( "error, no query string found" );
31+
QgsDebugMsg( "error, no query string found" );
3232
return parameters; //no query string? something must be wrong...
3333
}
3434

@@ -84,7 +84,7 @@ std::map<QString, QString> QgsGetRequestHandler::parseInput()
8484

8585
}
8686
parameters.insert( std::make_pair( key.toUpper(), value ) );
87-
QgsMSDebugMsg( "inserting pair " + key.toUpper() + " // " + value + " into the parameter map" );
87+
QgsDebugMsg( "inserting pair " + key.toUpper() + " // " + value + " into the parameter map" );
8888
}
8989

9090
//feature info format?
@@ -100,7 +100,7 @@ std::map<QString, QString> QgsGetRequestHandler::parseInput()
100100
{
101101
QString formatString = formatIt->second;
102102

103-
QgsMapServerLogger::instance()->printMessage( "formatString is: " + formatString );
103+
QgsDebugMsg( QString( "formatString is: %1" ).arg( formatString ) );
104104

105105
//remove the image/ in front of the format
106106
if ( formatString.compare( "image/png", Qt::CaseInsensitive ) == 0 || formatString.compare( "png", Qt::CaseInsensitive ) == 0 )
@@ -164,7 +164,7 @@ void QgsGetRequestHandler::sendGetStyleResponse( const QDomDocument& doc ) const
164164
void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoDoc, const QString& infoFormat ) const
165165
{
166166
QByteArray ba;
167-
QgsMSDebugMsg( "Info format is:" + infoFormat );
167+
QgsDebugMsg( "Info format is:" + infoFormat );
168168

169169
if ( infoFormat == "text/xml" )
170170
{

‎src/mapserver/qgshostedrdsbuilder.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
***************************************************************************/
1818

1919
#include "qgshostedrdsbuilder.h"
20-
#include "qgsmapserverlogger.h"
20+
#include "qgslogger.h"
2121
#include "qgsmslayercache.h"
2222
#include "qgsrasterlayer.h"
2323
#include "qgscoordinatereferencesystem.h"
@@ -35,7 +35,7 @@ QgsHostedRDSBuilder::~QgsHostedRDSBuilder()
3535

3636
QgsMapLayer* QgsHostedRDSBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList<QTemporaryFile*>& filesToRemove, QList<QgsMapLayer*>& layersToRemove, bool allowCaching ) const
3737
{
38-
QgsMSDebugMsg( "entering." );
38+
QgsDebugMsg( "entering." );
3939

4040
if ( elem.isNull() )
4141
{
@@ -45,20 +45,20 @@ QgsMapLayer* QgsHostedRDSBuilder::createMapLayer( const QDomElement& elem, const
4545
QString uri = elem.attribute( "uri", "not found" );
4646
if ( uri == "not found" )
4747
{
48-
QgsMSDebugMsg( "Uri not found" );
48+
QgsDebugMsg( "Uri not found" );
4949
return 0;
5050
}
5151
else
5252
{
53-
QgsMSDebugMsg( "Trying to get hostedrds layer from cache with uri: " + uri );
53+
QgsDebugMsg( "Trying to get hostedrds layer from cache with uri: " + uri );
5454
QgsRasterLayer* rl = 0;
5555
if ( allowCaching )
5656
{
5757
rl = dynamic_cast<QgsRasterLayer*>( QgsMSLayerCache::instance()->searchLayer( uri, layerName ) );
5858
}
5959
if ( !rl )
6060
{
61-
QgsMSDebugMsg( "hostedrds layer not in cache, so create and insert it" );
61+
QgsDebugMsg( "hostedrds layer not in cache, so create and insert it" );
6262
rl = new QgsRasterLayer( uri, layerNameFromUri( uri ) );
6363
if ( allowCaching )
6464
{

0 commit comments

Comments
 (0)
Please sign in to comment.