MCPcopy Index your code
hub / github.com/MapServer/MapServer / msDebug

Function msDebug

mapdebug.c:349–395  ·  view source on GitHub ↗

msDebug() ** ** Outputs/logs messages to the MS_ERRORFILE if one is set ** (see msSetErrorFile()) ** */

Source from the content-addressed store, hash-verified

347**
348*/
349void msDebug( const char * pszFormat, ... )
350{
351 va_list args;
352 debugInfoObj *debuginfo = msGetDebugInfoObj();
353
354 if (debuginfo == NULL || debuginfo->debug_mode == MS_DEBUGMODE_OFF)
355 return; /* Don't waste time here! */
356
357 if (debuginfo->fp)
358 {
359 /* Writing to a stdio file handle */
360
361#if defined(USE_FASTCGI)
362 /* It seems the FastCGI stuff inserts a timestamp anyways, so */
363 /* we might as well skip this one if writing to stderr w/ FastCGI. */
364 if (debuginfo->debug_mode != MS_DEBUGMODE_STDERR)
365#endif
366 {
367 struct mstimeval tv;
368 time_t t;
369 msGettimeofday(&tv, NULL);
370 t = tv.tv_sec;
371 msIO_fprintf(debuginfo->fp, "[%s].%ld ",
372 msStringChop(ctime(&t)), (long)tv.tv_usec);
373 }
374
375 va_start(args, pszFormat);
376 msIO_vfprintf(debuginfo->fp, pszFormat, args);
377 va_end(args);
378 }
379#ifdef _WIN32
380 else if (debuginfo->debug_mode == MS_DEBUGMODE_WINDOWSDEBUG)
381 {
382 /* Writing to Windows Debug Console */
383
384 char szMessage[MESSAGELENGTH];
385
386 va_start(args, pszFormat);
387 vsnprintf( szMessage, MESSAGELENGTH, pszFormat, args );
388 va_end(args);
389
390 szMessage[MESSAGELENGTH-1] = '\0';
391 OutputDebugStringA(szMessage);
392 }
393#endif
394
395}
396

Callers 15

msSLDApplySLDFunction · 0.85
msSHPDiskTreeOpenFunction · 0.85
msOutputFormatValidateFunction · 0.85
FLTApplySimpleSQLFilterFunction · 0.85
msQueryByAttributesFunction · 0.85
msQueryByFilterFunction · 0.85
msQueryByRectFunction · 0.85
msQueryByFeaturesFunction · 0.85
msQueryByPointFunction · 0.85
msQueryByShapeFunction · 0.85
msPrepareImageFunction · 0.85
msDrawMapFunction · 0.85

Calls 5

msGetDebugInfoObjFunction · 0.85
msGettimeofdayFunction · 0.85
msIO_fprintfFunction · 0.85
msStringChopFunction · 0.85
msIO_vfprintfFunction · 0.85

Tested by

no test coverage detected