hunchentoot icon indicating copy to clipboard operation
hunchentoot copied to clipboard

Allow for overriding get-backtrace

Open tdrhq opened this issue 3 years ago • 3 comments

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.

tdrhq avatar May 07 '21 19:05 tdrhq

Why a new function and not just changing get-backtrace?

stassats avatar May 07 '21 19:05 stassats

@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.)

tdrhq avatar May 07 '21 20:05 tdrhq

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.

stassats avatar May 07 '21 20:05 stassats