[Mapserver-dev] MS_ERRORFILE

Frank Warmerdam warmerdam at pobox.com
Wed Oct 27 22:26:48 EDT 2004


Folks,

Quite a few times I have found that errors are being issued with
msSetError(), but never get displayed to the user (or developer) because
nothing "up the stack" is looking for it.

We have a mechanism to see all errors issued via msSetError() by setting
the MS_ERRORFILE environment variable.  I for one essentially never have this
set, partly because it is a nuisance to set from within GDB (as set environment
does not seem to really affect the process that is run).  I have made a small
change so that a line of the form 'CONFIG MS_ERRORFILE "stderr"' will result
in a putenv() call within the process.  This means that error reporting can
be enabled within a mapfile (though in fact the value will stick outside the
narrow context of the map).  I have also changed it so that -all_debug on
the commandline for shp2img will always set MS_ERRORFILE=stderr.

However, I am wondering if we can go a bit further, and have turning on map
level debugging always set MS_ERRORFILE=stderr *if* MS_ERRORFILE isn't already
set.  This would mean, in my mind, that turning on the MAP DEBUG statement would
help get alot more sigificant debug info into the log.

Any objections?  Questions?  Suggestions?

I realize this is adding a feature after the freeze, but it seems pretty
harmless, and I really think it is important for us to fine tune support for
users to debug mapserver problems.  There seem to be alot of problems where
a developer has to go through mapserver in gdb to figure out what is going
wrong, and that isn't a solution that scales well.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the mapserver-dev mailing list