Lisp HUG Maillist Archive

Delivered command-line applications and *error-output*

Hello,

I am delivering a command line utility in which I rebound the *error-output* variable to a stream created with sys:make-stderr-stream.

When an error occurs, a backtrace is printed on *standard-output*, how can I make sure all errors are consistently printed to *error-output* and only valid output sent to *standard-output* ?


Best Regards,
Camille


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Delivered command-line applications and *error-output*

On 29 Mar 2013, at 11:55, Camille Troillard wrote:

> 
> When an error occurs, a backtrace is printed on *standard-output*, how can I make sure all errors are consistently printed to *error-output* and only valid output sent to *standard-output* ?

I think the trick is to have a fallback error handler which uses dbg:output-backtrace to generate the backtrace hung on cl:*debugger-hook*.

When I did this I arranged life such that I never expected to call this.  One consequence of that was that when this *did* get called things were generally terminally broken, and it needed to be really careful as a result (one common thing was that something else had just tried to print on *error-output* and got an error doing so...).

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:35 UTC