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

Function writeLog

mapserv.c:46–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44mapservObj* mapserv;
45
46int writeLog(int show_error)
47{
48 FILE *stream;
49 int i;
50 time_t t;
51 char szPath[MS_MAXPATHLEN];
52
53 if(!mapserv) return(0);
54 if(!mapserv->map) return(0);
55 if(!mapserv->map->web.log) return(0);
56
57 if((stream = fopen(msBuildPath(szPath, mapserv->map->mappath,
58 mapserv->map->web.log),"a")) == NULL) {
59 msSetError(MS_IOERR, mapserv->map->web.log, "writeLog()");
60 return(-1);
61 }
62
63 t = time(NULL);
64 fprintf(stream,"%s,",msStringChop(ctime(&t)));
65 fprintf(stream,"%d,",(int)getpid());
66
67 if(getenv("REMOTE_ADDR") != NULL)
68 fprintf(stream,"%s,",getenv("REMOTE_ADDR"));
69 else
70 fprintf(stream,"NULL,");
71
72 fprintf(stream,"%s,",mapserv->map->name);
73 fprintf(stream,"%d,",mapserv->Mode);
74
75 fprintf(stream,"%f %f %f %f,", mapserv->map->extent.minx, mapserv->map->extent.miny, mapserv->map->extent.maxx, mapserv->map->extent.maxy);
76
77 fprintf(stream,"%f %f,", mapserv->mappnt.x, mapserv->mappnt.y);
78
79 for(i=0;i<mapserv->NumLayers;i++)
80 fprintf(stream, "%s ", mapserv->Layers[i]);
81 fprintf(stream,",");
82
83 if(show_error == MS_TRUE)
84 msWriteError(stream);
85 else
86 fprintf(stream, "normal execution");
87
88 fprintf(stream,"\n");
89
90 fclose(stream);
91 return(0);
92}
93
94void writeError(void)
95{

Callers 2

writeErrorFunction · 0.85
mainFunction · 0.85

Calls 4

msBuildPathFunction · 0.85
msSetErrorFunction · 0.85
msStringChopFunction · 0.85
msWriteErrorFunction · 0.85

Tested by

no test coverage detected