@@ -23,7 +23,7 @@ map service syntax for SOAP/HTTP POST
23
23
#include " qgsgetrequesthandler.h"
24
24
#include " qgssoaprequesthandler.h"
25
25
#include " qgsproviderregistry.h"
26
- #include " qgsmapserverlogger .h"
26
+ #include " qgslogger .h"
27
27
#include " qgswmsserver.h"
28
28
#include " qgsmaprenderer.h"
29
29
#include " qgsmapserviceexception.h"
@@ -62,7 +62,7 @@ void dummyMessageHandler( QtMsgType type, const char *msg )
62
62
63
63
output += msg;
64
64
65
- QgsMapServerLogger::instance ()-> printMessage ( output );
65
+ QgsDebugMsg ( output );
66
66
67
67
if ( type == QtFatalMsg )
68
68
abort ();
@@ -73,44 +73,44 @@ void printRequestInfos()
73
73
{
74
74
#ifdef QGSMSDEBUG
75
75
// 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" ) );
78
78
79
79
if ( getenv ( " REMOTE_ADDR" ) != NULL )
80
80
{
81
- QgsMSDebugMsg ( " remote ip: " + QString ( getenv ( " REMOTE_ADDR" ) ) );
81
+ QgsDebugMsg ( " remote ip: " + QString ( getenv ( " REMOTE_ADDR" ) ) );
82
82
}
83
83
if ( getenv ( " REMOTE_HOST" ) != NULL )
84
84
{
85
- QgsMSDebugMsg ( " remote host: " + QString ( getenv ( " REMOTE_HOST" ) ) );
85
+ QgsDebugMsg ( " remote host: " + QString ( getenv ( " REMOTE_HOST" ) ) );
86
86
}
87
87
if ( getenv ( " REMOTE_USER" ) != NULL )
88
88
{
89
- QgsMSDebugMsg ( " remote user: " + QString ( getenv ( " REMOTE_USER" ) ) );
89
+ QgsDebugMsg ( " remote user: " + QString ( getenv ( " REMOTE_USER" ) ) );
90
90
}
91
91
if ( getenv ( " REMOTE_IDENT" ) != NULL )
92
92
{
93
- QgsMSDebugMsg ( " REMOTE_IDENT: " + QString ( getenv ( " REMOTE_IDENT" ) ) );
93
+ QgsDebugMsg ( " REMOTE_IDENT: " + QString ( getenv ( " REMOTE_IDENT" ) ) );
94
94
}
95
95
if ( getenv ( " CONTENT_TYPE" ) != NULL )
96
96
{
97
- QgsMSDebugMsg ( " CONTENT_TYPE: " + QString ( getenv ( " CONTENT_TYPE" ) ) );
97
+ QgsDebugMsg ( " CONTENT_TYPE: " + QString ( getenv ( " CONTENT_TYPE" ) ) );
98
98
}
99
99
if ( getenv ( " AUTH_TYPE" ) != NULL )
100
100
{
101
- QgsMSDebugMsg ( " AUTH_TYPE: " + QString ( getenv ( " AUTH_TYPE" ) ) );
101
+ QgsDebugMsg ( " AUTH_TYPE: " + QString ( getenv ( " AUTH_TYPE" ) ) );
102
102
}
103
103
if ( getenv ( " HTTP_USER_AGENT" ) != NULL )
104
104
{
105
- QgsMSDebugMsg ( " HTTP_USER_AGENT: " + QString ( getenv ( " HTTP_USER_AGENT" ) ) );
105
+ QgsDebugMsg ( " HTTP_USER_AGENT: " + QString ( getenv ( " HTTP_USER_AGENT" ) ) );
106
106
}
107
107
#endif // QGSMSDEBUG
108
108
}
109
109
110
110
QFileInfo defaultProjectFile ()
111
111
{
112
112
QDir currentDir;
113
- QgsMSDebugMsg ( " current directory: " + currentDir.absolutePath () );
113
+ QgsDebugMsg ( " current directory: " + currentDir.absolutePath () );
114
114
fprintf ( FCGI_stderr, " current directory: %s\n " , currentDir.absolutePath ().toUtf8 ().constData () );
115
115
QStringList nameFilterList;
116
116
nameFilterList << " *.qgs" ;
@@ -163,16 +163,12 @@ int main( int argc, char * argv[] )
163
163
164
164
// Instantiate the plugin directory so that providers are loaded
165
165
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 () );
174
170
175
- QgsMSDebugMsg ( qgsapp.applicationDirPath () + " /qgis_wms_server.log" );
171
+ QgsDebugMsg ( qgsapp.applicationDirPath () + " /qgis_wms_server.log" );
176
172
177
173
// create config cache and search for config files in the current directory.
178
174
// These configurations are used if no mapfile parameter is present in the request
@@ -208,18 +204,18 @@ int main( int argc, char * argv[] )
208
204
{
209
205
if ( strcmp ( requestMethod, " POST" ) == 0 )
210
206
{
211
- QgsMSDebugMsg ( " Creating QgsSOAPRequestHandler" );
207
+ QgsDebugMsg ( " Creating QgsSOAPRequestHandler" );
212
208
theRequestHandler = new QgsSOAPRequestHandler ();
213
209
}
214
210
else
215
211
{
216
- QgsMSDebugMsg ( " Creating QgsGetRequestHandler" );
212
+ QgsDebugMsg ( " Creating QgsGetRequestHandler" );
217
213
theRequestHandler = new QgsGetRequestHandler ();
218
214
}
219
215
}
220
216
else
221
217
{
222
- QgsMSDebugMsg ( " Creating QgsGetRequestHandler" );
218
+ QgsDebugMsg ( " Creating QgsGetRequestHandler" );
223
219
theRequestHandler = new QgsGetRequestHandler ();
224
220
}
225
221
@@ -231,7 +227,7 @@ int main( int argc, char * argv[] )
231
227
}
232
228
catch ( QgsMapServiceException& e )
233
229
{
234
- QgsMSDebugMsg ( " An exception was thrown during input parsing" );
230
+ QgsDebugMsg ( " An exception was thrown during input parsing" );
235
231
theRequestHandler->sendServiceException ( e );
236
232
continue ;
237
233
}
@@ -247,7 +243,7 @@ int main( int argc, char * argv[] )
247
243
QgsConfigParser* adminConfigParser = QgsConfigCache::instance ()->searchConfiguration ( configFilePath );
248
244
if ( !adminConfigParser )
249
245
{
250
- QgsMSDebugMsg ( " parse error on config file " + configFilePath );
246
+ QgsDebugMsg ( " parse error on config file " + configFilePath );
251
247
theRequestHandler->sendServiceException ( QgsMapServiceException ( " " , " Configuration file problem : perhaps you left off the .qgs extension?" ) );
252
248
continue ;
253
249
}
@@ -260,7 +256,7 @@ int main( int argc, char * argv[] )
260
256
if ( serviceIt == parameterMap.end () )
261
257
{
262
258
// tell the user that service parameter is mandatory
263
- QgsMSDebugMsg ( " unable to find 'SERVICE' parameter, exiting..." );
259
+ QgsDebugMsg ( " unable to find 'SERVICE' parameter, exiting..." );
264
260
theRequestHandler->sendServiceException ( QgsMapServiceException ( " ServiceNotSpecified" , " Service not specified. The SERVICE parameter is mandatory" ) );
265
261
delete theRequestHandler;
266
262
continue ;
@@ -285,7 +281,7 @@ int main( int argc, char * argv[] )
285
281
if ( requestIt == parameterMap.end () )
286
282
{
287
283
// do some error handling
288
- QgsMSDebugMsg ( " unable to find 'REQUEST' parameter, exiting..." );
284
+ QgsDebugMsg ( " unable to find 'REQUEST' parameter, exiting..." );
289
285
theRequestHandler->sendServiceException ( QgsMapServiceException ( " OperationNotSupported" , " Please check the value of the REQUEST parameter" ) );
290
286
delete theRequestHandler;
291
287
delete theServer;
@@ -297,7 +293,7 @@ int main( int argc, char * argv[] )
297
293
const QDomDocument* capabilitiesDocument = capabilitiesCache.searchCapabilitiesDocument ( configFilePath );
298
294
if ( !capabilitiesDocument ) // capabilities xml not in cache. Create a new one
299
295
{
300
- QgsMSDebugMsg ( " Capabilities document not found in cache" );
296
+ QgsDebugMsg ( " Capabilities document not found in cache" );
301
297
QDomDocument doc;
302
298
try
303
299
{
@@ -315,7 +311,7 @@ int main( int argc, char * argv[] )
315
311
}
316
312
else
317
313
{
318
- QgsMSDebugMsg ( " Found capabilities document in cache" );
314
+ QgsDebugMsg ( " Found capabilities document in cache" );
319
315
}
320
316
321
317
if ( capabilitiesDocument )
@@ -335,7 +331,7 @@ int main( int argc, char * argv[] )
335
331
}
336
332
catch ( QgsMapServiceException& ex )
337
333
{
338
- QgsMSDebugMsg ( " Catched exception during GetMap request" );
334
+ QgsDebugMsg ( " Catched exception during GetMap request" );
339
335
theRequestHandler->sendServiceException ( ex );
340
336
delete theRequestHandler;
341
337
delete theServer;
@@ -344,13 +340,13 @@ int main( int argc, char * argv[] )
344
340
345
341
if ( result )
346
342
{
347
- QgsMSDebugMsg ( " Sending GetMap response" );
343
+ QgsDebugMsg ( " Sending GetMap response" );
348
344
theRequestHandler->sendGetMapResponse ( serviceIt->second , result );
349
345
}
350
346
else
351
347
{
352
348
// do some error handling
353
- QgsMSDebugMsg ( " result image is 0" );
349
+ QgsDebugMsg ( " result image is 0" );
354
350
}
355
351
delete result;
356
352
delete theRequestHandler;
@@ -420,14 +416,14 @@ int main( int argc, char * argv[] )
420
416
421
417
if ( result )
422
418
{
423
- QgsMSDebugMsg ( " Sending GetLegendGraphics response" );
419
+ QgsDebugMsg ( " Sending GetLegendGraphics response" );
424
420
// sending is the same for GetMap and GetLegendGraphics
425
421
theRequestHandler->sendGetMapResponse ( serviceIt->second , result );
426
422
}
427
423
else
428
424
{
429
425
// do some error handling
430
- QgsMSDebugMsg ( " result image is 0" );
426
+ QgsDebugMsg ( " result image is 0" );
431
427
}
432
428
delete result;
433
429
delete theRequestHandler;
0 commit comments