hunchentoot
hunchentoot copied to clipboard
Allow for overriding get-backtrace
On Lispworks, the default trivial-backtrace output is super verbose, with all the variables displayed. Now this is fine for development, but on production this is is still logged to stdout even if it isn't show to users. This can cause two things: a) it makes my logs grow fast if there's an error, and b) it might log sensitive information to disk in clear text.
This PR just allows that to be overriden. It doesn't change the default behavior. My intended use is to override this just in production to only log the backtrace without the bindings. Perhaps even do more complicated things like remove specific bindings from the output.
Why a new function and not just changing get-backtrace?
@stassats The conditions.lisp
file wasn't dependent on any acceptor related code, so it made sense to keep it that way. I would have to move the get-backtrace to somewhere after the acceptor class is defined, which felt unnatural. (EDIT: I wouldn't have to move it after the acceptor class is defined, because the defmethod doesn't use the acceptor class. But it still felt wrong to take an acceptor argument that is unused.)
Moving code around is perfectly natural. So, I would accept: a method named get-backtrace and exported. And currently the documentation says "A method", while it's attached to a generic function.