Graham Dumpleton wrote: > Dan Eloff wrote .. > >> I've been using html formatted tracebacks in my handlers for a little >> while, and it's working rather well. Here's my proposal to add it to >> mod_python. Once we've reached agreement I'll add it and attach the >> files. >> >> -Add a file exception.html to mod_python directory, it is the >> standalone html page used for displaying tracebacks. It is loaded once >> as a string.Template instance and cached. The template has one >> variable, $traceback, which is substituted with the normal mod_python >> traceback. >> >> -The logic for formatting the traceback resides in exception.html as >> javascript and can be fully customized. If it encounters an error >> during formatting or if javascript is disabled, the traceback will be >> visible as normal with no formatting. >> >> -Uses markup and css to highlight important information in the >> traceback. This can be customized by editing the styles in >> exception.html. If you wish, by editing the javascript in >> exception.html, you can have complete control over how the traceback >> is formatted. >> >> -Supports filters easily defined in the javascript that can hide or >> show traces conditionally. By default a filter is enabled that hides >> mod_python traces. When hidden, traces shrink down to 2px high colored >> stripes. By clicking on the appropriate toggle link at the top of the >> traceback you can toggle the filter to show or hide the matching >> traces. >> >> -One new option is added at the outermost scope of httpd.conf, defaulting >> as: >> PythonOption mod_python.html_traceback On >> >> Which if set to Off, will result in the usual tracebacks you get in >> mod_python. >> >> Screenshot of demo attached. >> > > Hmmm, I didn't think you were wanting to go to that level of customisation. > If you do, I would suggest that we add a new directive to mod_python called > something like PythonExceptionHandler. The idea being that details of any > exception be supplied to your user supplied handler and everything is left up > to you as to how you render the page. I suggest this as I'm not real keen on > an approach whereby it depends on you having a special exception.html file > somewhere as that approach may not work in a lot of situations. By using a > handler, you can still use the approach you suggest, but that is up to you > and it wouldn't be dictating a specific way of doing things on people > that may not work for everyone. If there is a default exception handler, it wuold be nice to be able to set the HTML file used as a template using a PythonOption as well...
David